Tuesday, February 15, 2022

Right and Wrong, Well and Poorly, and the Art of Programming

Writing, painting, drawing, acting. These are arts that you cannot really do wrong, but you can do poorly. If a student writes a weak, unstructured, meandering essay, a good teacher will have to tell them that they did it poorly. A less dedicated teacher may decide not to give such feedback or even to lie that the work is good. Remove the feedback system, and the author will have to draw conclusions about their writing for themselves, subject to all the usual bugaboos like impostor syndrome and the Dunning-Kruger effect.

Programming is different. You can do it poorly, but you can also do it wrong. If your program does not compile, it is not really a program at all. That is, the syntax of a programming language determines what constitutes a valid program, and if you don't have valid syntax, you only have an approximation of a program. You have a non-program. Once you've done it right—once you have something that is, in fact, a program—only then can you consider whether you've done it poorly or well. Put another way, you cannot even program poorly unless you have programmed.

This puts learners of programming in a unique situation in education, as far as I can tell. The closest relative may be poetic forms like haiku. If someone walks up to you, shows you four lines in iambic pentameter, and asks, "How do you like my haiku?" the only real answer is that the question is malformed. It is not a haiku at all. If someone hands you a bunch of monospace text and semicolons and asks, "How do you like my Java program?" then unless it compiles, all you can say is that it is not a Java program at all.

Proofs and philosophical arguments are interesting to consider. For these forms, each step should follow logically from the previous. Consider what happens if a nascent mathematician produces a "proof" but the steps do not logically follow from each other. Is it a wrong proof or is it not a proof at all? That is, can a proof be wrong? I think most mathematicians would agree with me that it is not a proof since the question remains unproven. Notice, though, that in the absence of an evaluator, or in the presence of evaluators' inevitable oversights, a learner may not recognize the distinction. This can be addressed by formal theorem-proving systems, which are, essentially, programming.

It seems then that computer programming is the best tool for teaching someone that truth exists. Without the intervention or explanation by a teacher, a learner can see that some things are programs and some things are not.

Recently, I asked my students to evaluate their accountability to a team with respect to a stated methodology. Several students presented arguments in this form: (1) I followed the methodology. (2) There was one part I didn't follow. (3) In conclusion, I followed the methodology. This kind of intellectual dishonesty pervades undergraduate writing and thinking, although I cannot tell if it is getting worse or if I am getting tired. The compiler doesn't care how much I want the text in this file to be a Java program. It won't take sympathy on you, it won't tire of reading, and it won't lie. 

No comments:

Post a Comment