This week has been hectic for a lot of reasons. Getting my grades and comments in for progress reports has just been part of it. I haven’t had the time or energy to write much at all other than comments for progress reports. But I have been doing a little reading and some thinking. Crystal Furman had a great post earlier this week that was really good. CODING COMPREHENSION is about how some students can understand the syntax and commands but new really comprehend what the code is doing.
What I see a lot of is students who can tell you how to set up a loop or a decision statement but can’t easily make the move to using them to solve problems. They understand the problem but they are not really sure how to apply code to solve it. It’s the age old problem that we are teaching a language and how to use it at the same time. But it is not a natural language so learning the words is not enough.
A lot of people point out block programming languages and how they remove syntax errors from the equation. And there is value to that. Students can create a loop and not get lost with semi colons or errors in case for keywords and that all makes some things easier. But if they don’t realize that a loop is what they need there is still a big problem. I’m starting to think that syntax is not as big a part of the problem of learning how to program as I used to think.
The biggest problem is helping students to think in programming. They need some help seeing how to apply the statements, keywords and other things that make up the mechanics of programing. There was some discussion about teaching coding comprehension on Facebook (and you thought it was just for cute cat pictures) in the AP Computer Science Teachers group.
The discussion there lead to people talking about giving students code snippets and asking them to explain, using only English words, what the code was doing. Some teachers reported students having real problems doing this. I imagine that is the case. One hopes that practice would help here though.
I think it is important not to get too tricky with the code samples we ask students to explain though. We don’t want to model poor coding practices. We don’t want students to think that writing tricky to understand and hard to read code is a good thing. It’s not! What we want them to learn is the right way to do things. Being able to understand tricky or poorly written code is something they will get plenty of practice with reading their own code.
How are others dealing with this issue? Do you have any lecture tricks? Any project suggestions? Are you asking students to explain code they didn’t write? Something else?