Anyway, the commenter suggests that programming and writing are the same activity, and justifies this with their experience with learners of both languages and programming languages. As usual with things I get the urge to comment on, they’ve got some things right and some things wrong.
They’re definitely right about one thing: they’re seeing a very deep similarity between people who very effectively know about the [programming] language, but can’t actually use the [programming] language. They suggest:
We should be immersing students in good code. We should be burying them in idiom after idiom after idiom, allowing them to acquire the ability to program without explanation.
Great idea. One that should be done, of course, but it’s also not the whole story. In keeping with our writing analogy, let me paraphrase another bit of writer advice: “If you want to be a good writer, write! And keep writing.” This is also important: you can’t just know about the language, you can’t just read the language, you’ve got to write the language. And that goes for programming, too.
How many programming classes have you taken (or taught!), where you had to code only two or three smallish programs? Or less? Asking for good programmers to be generated by a system like this is indeed quite like asking for good writers to be generated from a system like this. Except that people are asked to write from, what, sixth grade (about 12 years old) or earlier? And people are expected to write in far more than just their writing classes. (I could go on about how we should be teaching programming to everyone starting that young, but that’s a rant for another day, though I’ve hinted at it before.)
So is programming like writing? Nope.
Wait, we just went through this really deep analogy that works really well, how could it not be the real story? Well, it’s kind of like confusing correlation and causation. The problem is, this same similarity can be said for teaching anything. Really. Check out this wikipedia article on the cognitive domain of Bloom’s taxonomy. “Knowledge” (aka knowing about something) is the shallowest of learning. Teachers, of any subject, should know this stuff. Richard Feynman wrote about seeing the exact same problems in physics students when he visited Brazilian universities way back when. Surely physics is not like writing? ;)
And then there’s some important ways programming and writing differ. For one, writing is meant to be read. Code is meant to read and changed. By itself, this makes these two activities completely different. Imagine if an editor sent feedback to a writer like this: “Why are we mentioning anything about Ron’s thoughts here? The title of this book is Harry Potter. Please refactor this out to a separate book called Ron Weasley and the OH GOD A SPIDER. On second thought, that’s a terrible name. We might decide in the future that Ron should love spiders. What Ron Weasley Thinks of Spiders.” (This is not to suggest that writers don’t revise their work. They do, of course, but they don’t design their work around making revisions, they design it around being read.)
I should be writing something else right now, so let me kill this post with an exercise for the reader: what programming activities fit into what levels of Bloom’s taxonomy?
One more random thought: has anyone ever tried peer review of code in a programming class? (And I don’t just mean pair programming…) I’d be curious to hear how it was designed / how it went.