Learning to Write in English like Learning to Program

Imagine for a moment that you were going to teach writing in standard English in the same way we tend to teach computer programming.

Alright… Let’s learn to write. Before you can write, you need to know about the fundamentals of the language we’re going to use. A language is a collection of words and rules for how you combine those words. Words can be thought of as being of different types that determine the purpose and meaning of the words. For example, two types we’ll work with are nouns and interjections. There are other types, too, but we’ll get to those later.

For now, let’s write your first sentence. A sentence is a valid sequence of words. By valid we mean that the sentence would be recognized by an expert speaker of the language as being acceptable.

So, we need an example of a noun and an interjection to get us started… One frequently used noun is the word WORLD and a common interjection is HELLO.

The students, if dutiful, carefully take in the presentation, try to memorize the new terms you’ve introduced, and set about trying to write their first sentences.


error: unexpected token at line 1: WORLD


error: unexpected token at line 1: WORLD

Having exhausted the possible combination of the words, we introduce additional notational constraints

Well, it turns out that written English requires some additional syntactic sugar in order to be valid. We need to introduce punctuation into out writing, such as commas and periods.

and students set to work


error: unterminated string at line 1


compilation successful

Now, what’s wrong about this process? How could it be made better?

2 thoughts on “Learning to Write in English like Learning to Program

  1. This is a very accurate representation of the problems of learning to program and the difficulties I had here as a former CS student. I still like programming and your point here is a valid one. It feels like we are asked to play a game before we know the rules, and we ONLY learn the rules by breaking them, and being informed of them in a strange format quite foreign to us at the time. I have never had you for a C.S. class in the past but what ways would you teach programming more effectively and efficiently?

  2. Thanks for asking, Christian. I believe there are several things that can be done to make initial CS education more engaging.

    1. Begin by learning to read and explain code. Children don’t learn their native language by beginning with writing short stories; they learn to hear it, speak it, read it, and only then to write it themselves. Programmers, on the other hand, are handed syntactic formalisms of the language of interest and expected to work from that point.

    2. Focus on the meaning of code, rather than the syntax, initially. Too often, when novices are asked to explain what code does, they respond in a purely functional way (“well, we assign 2 to x, then…”), rather than looking at the big picture, i.e., what is the intention that the code represents?

    3. Work with code that can be refactored transparently. (See my post Goodbye, Hello World? as an example.) One needs to see the same problem context repeatedly, improved and expanded at each step, so that one can appreciate how the changes being made reflect improvements in this particular solution to the problem. Students need to see more than just single snapshots of code; they need to see code evolve as ones understanding of the problem changes.

    4. Work on problems that Matter (in the societal sense), or at least problems that matter (to the individual). The popular media computation curriculum from Mark Guzdial and Barbara Ericson attempts to address this by working with digital media files (images, sounds, video). Mike Buckley at University Buffalo engages his students with the needs of real people via a “Socially Relevant Computing” curriculum. I think there’s room to blend the two.

    5. Remember that we can’t solve problems that students haven’t yet experienced and learned to value. I can teach the mechanics of matrix algebra to a 4th grade student, but it’s a solution to problems that the 4th grader doesn’t yet have. Because of this (and possibly other issues regarding the developmental appropriateness of the topic), the learning won’t be “sticky”. In other words, we need to begin with questions, so that the answers are meaningful.

Leave a Reply

Your email address will not be published. Required fields are marked *