S4xE2: Physical Models of Java (Teaching Practice Byte)

January 8, 2024
S4xE2: Physical Models of Java (Teaching Practice Byte)

Episode Summary

Teaching Practice Byte (TPB): In our first TPB episode we invite Colleen Lewis back to the podcast to talk about her physical models of Java that help her teach students how Java objects work. Colleen was originally on our podcast way back in Season one! We go into detail about what kinds of classes she uses these models in, what the models are, how she uses them, where they would and would not work, and where the idea came from.

You can also download this episode directly.

Episode Notes

Physical Models of Java - 3D Java

3D Java - Resources


[00:00] Kristin: Hello and welcome to the CS-Ed podcast, a podcast where we talk about teaching computer science with computer science educators. I am your host, Kristin Stephens-Martinez, an associate Professor of the Practice at Duke University. Joining me today is Colleen Lewis, an associate professor of CS at the University of Illinois Urbana Champaign. Colleen is also the creator of CS Teaching Tips, a website with tips for teaching CS, and there are over 1,000 tips and a bunch of tip sheets. Colleen, thank you so much for coming on the podcast.

[00:33] Colleen: Thanks, Kristin. I’m super pumped to be here. I love talking about teaching.

[00:37] Kristin: So today’s episode is a TPB, our very first teaching practice byte. And given Colleen’s CS Teaching Tips, this seemed appropriate. So, in a single sentence, what would you say is your practice?

[00:50] Colleen: So I use physical or 3d objects to help students understand Java code.

[00:57] Kristin: OK. And you mean 3D as in, like, actual physical because when I read 3D, I was like, does that mean you also deal with, like, the virtual world and wearing those crazy headsets and all that?

[01:06] Colleen: Oh, yeah, there’s no AR or VR to be found in my practice. We’re talking like stuffed animals.

[01:13] Kristin: Awesome. All right. So before we talk about the tip, let’s talk about the context so that the audience knows where does this work? Where do you use it? Like, how many students are you using with it at once? So on and so forth.

[01:25] Colleen: Yeah. So I’ve used it at Harvey Mudd College. That’s where I used to teach. I’m now at the University of Illinois, Urbana Champagne. But there I was, teaching classes of 80 to 200. And these are all college students. I also work pretty closely with a lot of high school teachers, and they use some of these practices in their classrooms. And then a bunch of videos that I’ve made using these 3D objects are also in the CS AP CSA curriculum. Cool.

[01:51] Kristin: Cool. So, how do students feel about this?

[01:55] Colleen: You know, I had trouble at first where students were like, Colleen, there are stuffed animals on the board. Like why are there stuffed animals? This is infantilizing. And I was like, oh, yeah, I need to explain why I do this. And so I, at first, they hated it, but, but I think once I was able to explain, yo, I want to explain to you how Java works, and it’s not obvious, and pictures just aren’t enough. I need these 3D objects to help you understand sort of the core mechanisms of variable assignment in Java. And so these are a tool, and that tool just happens to be better than diagrams.

[02:33] Kristin: OK. So you did say 75 to 200 or 200ish students, right? And you’re talking about like a stuffed animal. Can the students all the way in the back see this? Like does it still work for them?

[02:43] Colleen: Yeah, sometimes I’m in a classroom where students can’t see me all the way in the back. But, I always put for any demo, I always put pictures in the slides that way they’ve got it for their notes. I do that for live coding. Here are the screenshots from this, you know, interactive session. I think that’s an important thing in general and particularly important when it might be hard for them to see.

[03:07] Kristin: Yeah. OK. So let’s go straight into talking about the tip itself. Which I’m aware that we are in an audio medium, talking about physical objects. So, there will be links or pictures in the transcript and the episode notes. But yeah, we’re just, we’re just gonna roll with it. Go ahead, Colleen.

[03:39] Colleen: Yeah. So the, the key idea is that variables are, are represented as little pockets, and a pocket can hold an int, and that’s just a number, or a pocket can hold a double. And so it’s a slightly bigger pocket, or a pocket can hold a reference to an object or an array. And that is a slightly bigger pocket, and then it holds something that I think of as a remote control. So I use little bookmarks with a ribbon connected to it and that ribbon then has a, a clothes pin on it to connect to an actual object or to an array. So it’s all about variables are pockets. When I assign a variable, I put something in that pocket where if I copy a variable, I take a copy of what’s in another pocket and move it to my new pocket.

[04:18] Kristin: OK? So you’re saying an actual, like, see through plastic pocket, right?

[04:22] Colleen: Yes.

[04:23] Kristin: Ok. And then if you assign a variable, do you have note cards and like a big fat marker or like, what do you do?

[04:31] Colleen: You know, it varies by the type. So, the doubles, I have those the size of a three-by-five card. And so then it’s just a new three-by-five card, or the ints are just a smaller, little sort of inch square-ish. The more interesting ones are the reference variables. And there I just have a bunch of these remote, so a bunch of these, you know, bookmarks with ribbons connected to a clothespin. So I just take out a new one, and I’m like, oh, I make a copy of the old one, and I put it in this second pocket.

[05:03] Kristin: Interesting, like my brain now suddenly went towards, like, so it’s this ribbon with the clothespin that I’m assuming you clip on to like an object of some kind. And my thought is like, is, does it make sense that the ribbon is connected to the bookmark thing as opposed to the object? Because I guess in my brain, I always thought of pointers belonging to the object, but that makes no sense. Now that I think about it.

[05:30] Colleen: Yeah. Yeah. And I think that gets at this really important piece of it’s really confusing to have multiple variables that reference the same object. Like, that idea of aliasing ends up being super tricky for students. And I think it’s part of how I identified. Oh, I think this is helpful. So, just a quick story is that, you know, I would always show students code where I had two variables referencing a single object. And I used to just draw the boxes and arrow diagrams and be like. Yup. Yup. Yup. You know, both variables can modify that object. And when I started modeling it with 3D objects, I started having students raise their hands and tell me, “Colleen, but that would mean that both of the variables could modify the object.” And I’m like, oh, that is what that means. And just thinking about the number of years where I hadn’t shown them the 3D objects, and they didn’t ask those questions and were probably interpreting the diagram incorrectly. And I, I think for me, it was really important to recognize, like, what is a really fundamental piece about reasoning about how Java works, and I think they were missing it without that concrete representation that they could more easily interpret correctly.

[06:45] Kristin: So do you have other examples than aliasing that you think this really helps students with?

[06:53] Colleen: Yeah. One is only, it seems a little silly because it’s like two minutes of instructional time. But I think that when students start with Java, they’re really confused about types. Like, what is all this nonsense? Particularly, I was teaching students who had previously learned Python. And so they’re like, what am I doing here? And I think just showing them a stack frame, which I just draw with a whiteboard marker, and then put an int, a double, and a boolean in there. I think I’m like, oh yeah, see, like we could think of these as different types of information that we’re storing, and they’re like, oh, ok. And I, I think, like getting students to the point with types where they say, oh OK. And not, oh my gosh, this is so confusing is like a huge win, and I think even just showing the picture of it and a few words sort of accomplishes that

[07:44] Kristin: I’m trying to think if there’s anything else that would be really useful to know, like, how hard would this be to make for someone else? Like, I’m assuming it sounds like it’s very like, what’s the word I’m looking for? Low, low barrier to entry if you’re willing to kind of collect the materials and not seem silly.

[08:01] Colleen: I think the not seeming silly is key. I think the first place to start would be that I have a lot of videos online and so just playing one of those videos in your classroom. So, it’s csteachingtips.org/3D. I’ve got resources where you can be like, oh, aliasing or inheritance sort of look by topic. And I think only if your students were like, “yeah, that was helpful,” would I think you should take the next step of, like, buying a bunch of materials and hot gluing things. And it’s honestly a lot of work to put together the kits, just in terms of hot gluing time. I don’t mind it because I can hot glue and watch TV. So, I’ve mailed out 50 sets of these kits. And I’m working on my next set of 50, so you can sign up to get a kit, but I’m really, really slow at making it.

[08:52] Kristin: Ok.

[08:53] Colleen: But I do have all the instructions of like, oh, here’s what to buy. None of it is very expensive. It’s all mainly using like teacher supplies.

[09:02] Kristin: Got it. Ok. So, but the, the video sounds like it gets you partly away there and also prototypes to find out, like is my particular kind of cohort of students that I have going to benefit from this.

[09:14] Colleen: Yeah, exactly. You can just play a video, or you can even just not use class time, share a few of the videos that you think might be helpful to students. See if they watch them, see if they like them. It’s pretty easy to dip your toe in, I think.

[09:28] Kristin: Awesome. All right. So the next thing that I wanted to talk about is kind of the mix of where do you think this would work and where do you think it won’t work? Because we kind of started talking about that. But let’s dive a little deeper. Like, in your opinion, why would this potentially not work? Why would it work in certain contexts better than others? And then maybe you can talk a little bit about where this idea came from because I think that might help with that explanation.

[09:58] Colleen: Yeah, I think one first piece is students when I started doing this, were really, really clear in coaching me where they were like Colleen, you try and trace through complicated code, and that seems like a good idea, but it’s actually a disaster because it’s super confusing. And so the thing students coached me through doing is only show a single step. I’ve got a complicated program. I set up before class the model before a line of code executes. And then all I do is show them one line of code executing. And that allows me to, like, redo it multiple times to make sure that they see what’s happening. OK. So that isn’t exactly like when does it not work? But this is it was intuitive to me to, like, show complicated stuff to help them understand it. And they were like, no, no, no, this is terrible. It’s so distracting.

[10:47] Colleen: OK? I think the other piece is I do have some trust with the students. I think it is tricky if they think it’s infantilizing. And so I think providing enough explanation of like why this might be helpful to them. I’ve had students say, oh, but like, I’m not a visual learner, and I’m like, oh, one learning styles are not a thing, but I just want to be respectful of them. Be like, oh yeah, here’s the tricky thing is you don’t know how Java works yet. And so words are not enough to communicate this. And so when we think about teaching, we think about what are all the modalities in which I can meaningfully represent this information. And so if a diagram is one of those, then we should use a diagram. If words are one of those, then we should use words.

[11:37] Kristin: So, is there anything else where you think it would work or not work?

[11:41] Colleen: Yeah, I think the thing is, it isn’t equally appropriate for all CS topics. Do you know what I mean? So, you know, I think it helps understand variable assignment and references, and then I think when you get into inheritance and you might have different types of variables, referencing a subtype of the object, I think that’s where it, like, is helpful. But for loops, I have other things where I use physical objects to help students reason about for loops. I, like, use a little game piece to move through the parts of a for loop to show how it’s sort of going, going through steps. But that’s like a fundamentally different representation. And so I think just these representations are, aren’t about all of Java, but more about assignment statements mainly.

[12:30] Kristin: Got it. I think that does make sense to me because, like for loops, there’s only so many times that you will loop through the loop before students, like, tune out even though each iteration of the loop is potentially different.

[12:40] Colleen: Yeah. And if you’re teaching for loops at a point where your students don’t understand how to add one to an int, like, you’re teaching wrong. Do you know what I mean? Like, that can’t be the hard thing when you’re doing for loops, for loops are complicated by themselves.

[12:53] Kristin: Yes, you should have confidence the student understands every line and code inside the for loop before you teach the for loop.

[13:00] Colleen: Yeah. Yeah. Yeah.

[13:01] Kristin: All right. So, since we talked before this episode, I know where this came from in terms of research. So how about you start talking about that since we have some time?

[13:11] Colleen: Yeah. So one thing that I’ve noticed in math education is that everyone learns, and read about also in math education, is that everyone learns things like addition using physical objects. Like, we just would never teach students addition without using physical objects. And I think we often underappreciate how abstract the idea that the squiggle that is the number three represents a quantity. Like that’s a really impressive thing that humans can recognize that squiggle as a quantity. And if we think about the fact that people essentially universally get to that level of abstraction, I think we need to think about like whoa what is the effective pedagogy that they’re using? And the key strategy is this concreteness fading or concrete representational abstract it’s referred to. You start with physical objects. Once you are, once students are rock in that you can transition them to pictures of objects. Once they can recognize that as quantity with addition or counting even, you transition them to those squiggles, which are our numbers. And, at any point, you can always go back to the previous representation. If the pictures aren’t working, go back to the physical objects. And in my Java teaching, I was showing them box and arrow diagrams. That’s sort of the pictures of objects. And I was showing them the abstract version. That’s the Java Code, but I never was showing them the concrete version. And so I think if we can do more to replicate the success of very early childhood math instruction, I think that’s a big win for us.

[14:43] Kristin: I wonder if there’s a way to do your physical manipulations without making the students feel like children.

[14:55] Colleen: Yeah. You know, I, the, the complaints about that essentially went away once I explained what I was doing and why?

[15:03] Kristin: So what, how do you explain it to them? Like, give us a script or something? If someone wanted to try this?

[15:10] Colleen: Yeah, I think to start, when we start with initial types, I think it is a little easier because they don’t look infantilizing. There’s no stuffed animals yet. And so I think, I think, that it’s maybe it’s maybe like a tip that I haven’t realized is starting with that. I think warms students up to this idea. I think the other one is being really open to students’ feedback. So I think of teaching as a collaborative activity. I refer to my students as team. But I really mean it in that, like, I can only be helpful to them if they help coach me in what is helpful and what’s not helpful. And so, hey, here’s this representation that might be helpful to you, and here’s why I think it might be helpful to you. But you all need to tell me, do you know what I mean? Like is this actually just more confusing? And so I think that way of always encouraging students to reflect on the instruction and give feedback, I think, can be helpful for that.

[16:12] Kristin: How do you get the feedback? Is it just like you’re standing in front of everyone and doing like a thumbs up, thumbs down? Or are you getting more precise feedback via like something written?

[16:21] Colleen: No, I do it. I do it a lot during class. So, like thumbs up, this is helpful. Thumbs down, this is not helpful. Thumbs up, what I said just made sense. Thumbs down, it did not make sense. And I typically, if students give me a thumbs down, I’ll be like, oh, can somebody ask me a question? Do you know what I mean? Like, I don’t know what’s hard about it. And so I’ll, I’ll even, sometimes I can repair in real-time. And otherwise, my lecture is set up with me talking for a little bit, them doing a problem. And so when they’re doing a problem, I’ll identify who had put a thumb down, and I’ll go to them, and I’ll be like, oh, can you explain to me why this was bad, and then I can do some repair work right after that to be like, ok, like here’s my current understanding of why that was bad. Here’s my attempt to repair that if you have other ideas, like flag me down during the next time where you’re working on something.

[17:11] Kristin: Oh, this, you, you saying that made me realize that maybe there’s a piece of context that we’re missing. Like how do you structure class? Because it clearly, you are not just lecturing at them for 75 minutes straight. So, how do you structure your class? How long is each segment?

[17:25] Colleen: Yeah, I think probably like each segment is probably like 5 to 10 minutes. So I’m talking for a little while, and then what I do is I design an activity to test whether or not they understood what that last five minutes. So I think I’m, I’m trying to build in that formative assessment and help me understand was my instruction lacking? Because if they can’t do it, I assume it’s my fault. And so that I think help that helps me get opportunities for students’ feedback and to see what’s working and not working. And then when I go back to revise a lecture for the next year, I have like chunks that worked fine and then chunks where I have written on my notes disaster that I like really need to rethink to better support students.

[18:16] Kristin: So, are these activities like peer instructions? Is there like a multiple-choice thing at the end that you kind of gather their answers and see what’s going on? Like what, what, how does. And then, to add on to that, what do you do with the students that finish early?

[18:34] Colleen: Oh, yeah. And the students that finish early, I just encourage them to chitchat. Because I think the extent to which in my classroom they can be forming community with other people who are learning this stuff. I think it’s just good for them. So I just encourage chitchat. And then it, I’ve done, I’ve done clickers, I’ve done not clickers, I’ve done paper, et cetera. I’ve done a bunch of different things, but a key thing is that it’s not only multiple choice, so it’s often “write code that,” and I will wander around and look at people’s papers even if I’m not, even if there’s something like write code that I can’t get the full picture like 75% got blank and blank. I can start to identify the types of problems that I’m seeing or the, the ways in which people are stuck. So I can go to a group or a pair that’s stuck and be like, oh, what about this hint? Does that help you get unstuck? What about this hint? Does that help you get unstuck? And that helps me know what hints I might want to embed in the instruction next time or what I might want to interrupt people and offer a hint if my task just is kind of falling flat.

[19:40] Kristin: Ok. So then you you, since you alternate back and forth with between these two activities, you’re getting a lot of formative feedback during class to get a sense of whether or not what you’re doing makes sense. So I think that that is very useful context for like even showing them these like manipulative physical things. Do you have any plans for future parts of this practice?

[20:03] Colleen: You know, teachers are always asking me like, when is it most important to use it? And so I’m still working on that. And now, I’ve organized the videos that I’ve made around specific topics in the AP CSA curriculum just because that’s where, like it’s a good example of a CS1 curriculum. And I think people can use that language to find what they need. And so I’m just working on new videos for stuff that they say is hard so we can experiment and see if we can try and help unlock some of that difficulty. And really being able to give teachers clearer advice of like, OK, if you’re only going to use three of these, here are the three. One of them is definitely like two minutes on types. And probably one of them is definitely aliasing, but I don’t know what the third or fourth would be.

[20:55] Colleen: Maybe one other is null. And in particular, when you create an array of an object type, it doesn’t make any objects I get, just get a bunch of null variables glued next to each other. And so I think that maybe is another one that’s really powerful.

[21:13] Kristin: So is it when, when you say null, is that a card, or is that an empty pocket?

[21:18] Colleen: Yeah. So a null so only variables that can reference an object are null or an object or in an array null. And so those are pockets that could hold a remote control. And in my representation, if a pocket doesn’t have a remote control in it, you can see a little ribbon X that I’ve glued in the back of the pocket. And so, right, to try and align the pocket representation with the box and arrow diagram where we would draw null is an X.

[21:43] Kristin: Oh. OK. So because when you said like an array with nulls glued together, I was like, what does that mean? Yeah.

[21:51] Colleen: And I think thinking about nothingness is really hard, and I’m resisting every urge to not like reach behind me to the whiteboard to show you one of these things because I was like, then, it breaks the podcast.

[22:04] Kristin: Well, I think it’s fine if you wanted to show it to me because I could have tried to describe it for the audience. But I think that’s fine. So, let’s segue straight to TLDL. Too long. Didn’t listen. Can you give me a rundown of your practice in three minutes or less?

[22:20] Colleen: I mean, the big picture is that I use physical objects to teach Java. But I think your concrete next step is to just go to csteachingtips.org/3D. I have a five-minute video where you would get to see the actual objects, and I try to explain why I think it’s helpful. And then there’s a bunch of resources there. If there’s a particular topic that you’re finding challenging in your classroom, you could see if you think one of the videos that I have for that might be helpful.

[22:48] Kristin: OK. I think I’ll add that you might need student buy-in before you potentially do any of this.

[22:52] Colleen: Yeah, I think I would just like, you know, casually share the link with students, be like, oh someone told me about this thing. Can some of you look and tell me what you think? Because then if you can get a few people to look at it, then next time in class, if you wanted to show a video, you could be like, oh, you know, I showed it to some students at office hours, and they liked it. So now I’m gonna try it in class, and we’ll see what you all think.

[23:15] Kristin: I, I love how receptive you are to feedback for the students because I feel like communicating that receptivity can be difficult, I think, for some people because it shows it’s, it’s a willingness to be a certain level of vulnerable that some people are not comfortable with doing yet for their students.

[23:35] Colleen: I think there’s a key strategy I have that allows me to be open to students’ feedback is I do not identify as a good teacher. I identify as a teacher who cares about their students’ learning. And I tell students, if you tell me on this feedback form that you think I do not care about your learning, I will be really offended. That would be unkind of you to do. But if you tell me that I am the worst teacher you’ve ever had, like that’s going to be feedback that helps me grow. And so I need that feedback. And so I think if I identify as a good teacher and then they tell me my teaching is not perfect, then it threatens my identity. But if I make that not part of my identity, then I can be on this path where I’m continuing to improve. I also never read my own teaching evaluations. So, even when students write written feedback for me, I have one of my TAs or another student summarize it for me because sometimes the words they choose to describe what they hate about me in my class still are hurtful. Do you know what I mean? But I think not reading your own teaching evaluations and not identifying as a good teacher, I think are really important to creating that openness to student feedback. And I think without that openness, you can’t get better as a teacher.

[24:47] Kristin: I like that. Identifying as a teacher that cares about their students rather than as a good teacher.

[24:54] Colleen: Yeah, And you might pick something else as long as it’s something that students wouldn’t give you feedback on. Your identity needs to be something students won’t give you feedback on.

[25:03] Kristin: I love that, that I think that’s a great way to close out. So, thank you so much for joining us, Colleen.

[25:08] Colleen: Yeah, this is great. Thanks so much, Kristin.

[25:10] Kristin: And this was the CS-Ed podcast hosted by me, Kristin Stephens-Martinez, and produced by Chris Martinez. And remember, teaching computer science is more than just knowing computer science. And I hope you found something useful for your teaching today.


Be sure to follow us on Twitter and Facebook, and subscribe on Apple Podcasts, Spotify, Amazon Music, or wherever you get your podcasts.