Object Array Frustration
It may be true that I didn’t get enough sleep last night or eat anything before school and woke up late enough that I was almost late to school. Maybe so. Regardless, my AP class this morning was objectively terrible. Not that there weren’t individual successes and insights. There were. But the biggest insight was my own, and it wasn’t pretty when that light bulb went on.
I had assigned what I thought was a pretty simple lab, which has now been revealed to me as being totally contrived and false exercise that not only failed to teach anything but has perhaps pushed through enough conceptual territory so as to confuse students. I made a few mistakes, one of them covered by Simon Holland in his 1997 paper Avoiding Object Misconceptions under the heading “Objects are not simple records”. But the biggest problem is that students are not facile enough with the syntax and the concepts yet to go this fast. This is frustrating because I think they could be if my assignments were better and more focused.
I’m not taking the responsibility off students who haven’t done the assigned reading, but I’m glad to know sooner rather than later that I haven’t done what was needed to insure their understanding. This is what I saw today:
- Despite having done homework involving arrays and being tested on arrays, some students do not really understand what an array is — or at least can’t do anything useful with one.* Java’s clunky array declaration syntax doesn’t help at all when you couple it with the shortcuts (string literals, array declarations, etc) and multiple ways to do the same thing. In a way, I wish that this course was in Python (one — and preferably only one — obvious way to do it) even though I don’t have as much experience with Python as I do with Java.
- I sometimes write instructions like “use another loop to…” that seem arbitrary and so students tend to look for these cues instead of thinking independently. Of course, there are an equal number that disregard the instructions entirely and head off in a random direction…
- Students have no idea what the purpose of Java’s classes might be, despite a chapter on Object Oriented design. This adds to my slight bias against an “Objects First” approach, although I am trying to keep an open mind. I do think should have stayed with simpler but more rigorous exercises using primitives and Strings until we had a motivation for using objects — encapsulation and data hiding. I should have pushed that hard immediately to clarify the meaning of a class. Without motivation, all my instructions to use objects probably seem arbitrary. I could tell, because some students were putting the program’s logic or even data into the class definitions. Why not? It’s just another place to put code. Instructional fail.
- Why did I introduce inheritance already? No one got anything out of that except some ill-advised class diagrams, and we haven’t used it for anything. Again, no point to introduce this topic until there’s a use for it.
If I am going to follow the Head First Java book chapter by chapter (which I have been doing so far) then I have to keep a much tighter rein on the students, checking their reading, and forcing them to engage with the text. I have let them float along, thinking that assigning homework backed up with a quiz every few weeks would insure that they read and understood. Perhaps this illuminates flaws in the sequence I’ve somewhat blindly taught up to this point. I need to totally rethink this for next year. And this year, I wonder where to go next?
* Despite these struggles, I still can’t think of a better explanation than what’s given in the Sierra and Bates Head First Java chapter 3. (They say that variables are like cups, able to hold values. Primitives are items you put right into the cups, while object instances live outside the cups and the reference is like a remote control for that object which gets placed into the cup. So, then, an array is like a numbered tray of cups, and if you create instances to fill the array you are putting a remote in every cup.) I just think they try to read some of this stuff too much like English or too loosely. For example: I said
Dog dogs = new Dog; so why should I have to also say
dogs = new Dog();? It’s easy to for us to explain that this is because declaration and initialization are independent, but hard to make those words meaningful to people who have no real programming experience.