TITLE: Some Thoughts on How to Teach Programming Better
AUTHOR: Eugene Wallingford
DATE: March 24, 2015 3:40 PM
How Stephen King Teaches Writing,
Jessica Lahey asks Stephen King why we should teach grammar:
Lahey: You write, "One either absorbs the grammatical
principles of one's native language in conversation and in
reading or one does not." If this is true, why teach grammar
in school at all? Why bother to name the parts?
King: When we name the parts, we take away the mystery
and turn writing into a problem that can be solved. I used
to tell them that if you could put together a model car or
assemble a piece of furniture from directions, you could
write a sentence. Reading is the key, though. A kid who
grows up hearing "It don't matter to me" can only learn
doesn't if he/she reads it over and over again.
There are at least three nice ideas in King's answer.
All of these are true of teaching programmers, too, in their own
- It is helpful to beginners when we can turn writing into a
problem that can be solved. Making concrete things out of
ideas in our head is hard. When we giving students tools
and techniques that help them to create basic sentences,
paragraphs, and stories, we make the process of creating a
bit more concrete and a bit less scary.
- A first step in this direction is to give names to the
things and ideas students need to think about when writing.
We don't want students to memorize the names for their own
sake; that's a step in the wrong direction. We simply need
to have words for talking about the things we need to talk
about -- and think about.
- Reading is, as the old slogan tells us, fundamental. It
helps to build knowledge of vocabulary, grammar, usage, and
style in a way that the brain absorbs naturally. It creates
habits of thought that are hard to undo later.
Finding ways to integrate design recipes, patterns, and case
studies is an area I'd like to explore more in my own teaching.
- We need ways to demystify the process and give students
concrete steps they can take when they encounter a new
used in the How to Design Programs approach is a great
example. Naming recipes and their steps makes them a part
of the vocabulary teachers and students can use to make
programming a repeatable, reliable process.
- I've often had great success by giving names to design and
implementation patterns, and having those patterns become
part of the vocabulary we use to discuss problems and
solutions. I have a category for
posts about patterns,
and a fair number of those relate to teaching beginners.
I wish there were more.
- Finally, while it may not be practical to have students read
a hundred programs before writing their first, we cannot
underestimate the importance of students reading code in
parallel with learning to write code. Reading lots of good
examples is a great way for students to absorb ideas about
how to write their own code. It also gives them the raw
material they need to ask questions. I've long thought that
Clancy's and Linn's work on
case studies of programming
deserves more attention.