I was reading a tweet from a person saying they lost points a program written with pen and paper because the teacher thought the code would not run. When the student asked the teacher to write the code on the computer it ran.
The Twitter discussion was on the wrongness of code assignments on paper but I am not sure that paper coding assignments are necessarily wrong. I suspect that the problem in the Twitter user's case may have been a teacher who is experienced. I could be wrong of course.
The real problem is a teacher putting too much faith in their own mental execution of the code on the paper. I have found it a good practice to enter code I was the least unsure of into an IDE and run it on the computer. I’d almost always check code I thought did not work. Students can be very clever and write code that doesn’t look like it will work but does work. Or code that does look like it works but doesn’t.
This all points to problems with testing computer programming in general. Writing code for evaluations is problematic in a number of ways. Yes, I know the AP exams do it that way. I’ve only graded the AP A exam once but I can tell you it’s not that easy. Handwriting can be hard to read for starters. I’ve already mentioned how clever students can be. I loved the 10 line code answer for a guestion that was looking for a one line return statement. I could have saved myself a lot of time if I could have verified it by running it.
Asking students to write code in an IDE offers logistical issues for starters. There is also the issue of students being able to look at each other’s screens and sharing files. Some object to students using autocorrect, error checking, and help files. All the sorts of things professional developers use. Some teaches do prefer code turned in electronically because it allows for auto graders. I’ve discussed them here several times. Basically, mixed feelings.
Evaluating student knowledge is one of the more difficult tasks programming teachers. It’s a problem with no easy answers. For now, I think, the best policy is to use a variety of assessments.