Teaching programming is not getting easier.

Teaching programming is not getting easier.  When I offered the Python course I had a book in mind.  I figured that would make the course much easier to teach.  Two weeks into the course I switched books for something a bit better written and a bit more comprehensive.  This is actually the first time I have followed a book closely when teaching programming.  I am using the book simply because my Python experience is nil.  I like the book, it does want I think a book should do, gives enough information to learn from but not so much that it holds your hand and does the problem solving for you.  So I like the book.  That solves absolutely nothing.  The kids won’t read it.  If I give the kids an easy (to me at least) problem like “find the sum of the odd integers in this list” I still get the look from at least half the class that I might as well of asked them to build an anti-gravity engine for a flying car.  Teaching syntax is easy.  The kids write the syntax down in their notes or save a code snippet and they have the idea what it does.  Getting from the given exercise to the point where they type relevant code is a whole different story.  I cannot find a programming book that teaches that skill.

Experience has taught me that the average person does not want to think, be it a high school kid or college kid or soldier or your average adult.  Thinking is work and can easily result in failure and embarrassment.  Thinking is hard work.  That step between the given problem and writing relevant code requires thinking, and sometimes lots of it.  This is the point where teachers get the inevitable “but this is too hard” whine thirty seconds after assigning the problem and well before the kid has really tried the problem.

I used to be a math teacher and math has somewhat the same thinking requirements and the same issues.  The big difference is the kids would have 10 home work problems a night, 8 of which were very easy to do so they would do those and ignore the hard ones.  The result would be an 80%.  With math there are a lot of problems with incremental steps of difficulty for almost any new concept.  Those students that can do the 70 or 80% in math survive just fine.  In math I usually have several different teaching strategies for a concept.  I have multiple “gimmicks” for devolving problems to make them easier to solve.  I have other math teachers to ask for new approaches and a whole lot of cool stuff on the internet to use as resources.   Programming on the other hand has diddly.

In programming there are 4 homework problems over the period of a week, none of which are “easy”, and all require some problem solving and thinking.  There is somewhat of an incremental progression to the problems but that step from written problem to code is always a big one.  It is somewhat similar to solving word problems in math, every student’s favorite task.  For programming there are no colleagues available that have as much or more experience to pull teaching ideas from, if there are any other programming teachers at all.  There are no pedagogical resources anywhere online for teaching strategies.  After watching a number (3) of programming teachers teach it seems the teaching strategy is pretty consistent; show and tell and hope.

A kid can do pretty well in high school just with an average memory.  In math memorization of techniques can go a long way.  In programming memorization is a trivial part of the skill set needed to succeed.   The primary skills needed are problem solving, strategizing, devolving problems into sub-tasks, interpreting, and general full bore head scratching.  Those are an absolute bugger to teach, especially to kids that are not all that interested in learning those difficult skills.  I will go out on a limb here and claim the difference from the good students (top 10%) and the rest is the willingness and desire to improve on that list of skills.  I will go way out there and claim that the difference between a great teacher and a good teacher is a great teacher can get a good part of that lower 90% to want to improve that thinking related skill set.  I strive to be a great teacher but I have one little character flaw holding me back – I like programming for the challenge.  This does not equate for about 90% of my students.  So I am back to teaching programming is not getting easier.

7 Responses to “Teaching programming is not getting easier.”

  1. Mike Zamansky Says:

    Not a direct comment on your post, but it reminded me of a post I’ve been meaning to write about something that makes me nuts.

    We know how hard real teaching and here you’re just hitting the tip of the iceberg. Yet I keep seeing summer programs and after school programs exclaim “learn to make a real phone app in X days” or “our program is comparable to taking APCS” or “make a game in a week” and so on.

    If it was as easy as they say, we wouldn’t have a tech talent problem.

    My personal feeling, many of those programs are well meaning, but more style than substance.

    In any event, I think it makes our jobs harder.

    Oh well – to paraphrase Alfred — it just means that our kids will get the good jobs.

  2. What makes teaching programming difficult? | Gas station without pumps Says:

    […] been following Garth’s CS Education Blog for a while, and his post Teaching programming is not getting easier resonated with me, particularly the […]

  3. John Burnette Says:

    Do yourself a favor and check out “How to Design Programs” a free version of which is available on line. While the book uses Racket (a recent branch of Scheme) it is NOT about the language of choice.

    As a former math teacher you will instantly recognize the educational philosophy of Polya throughout the textbook. Poyla, by the way, would be aghast at math education being described as 80% routine. That may result in placid math classes, but it won’t result in any worthwhile educational results.

    If you haven’t yet read it, this essay http://www.maa.org/sites/default/files/pdf/devlin/LockhartsLament.pdf is an excellent description of what’s wrong with math education today. Math deserves a central place in our curriculum because of its beauty and because of the changes it makes in our students’ noggins when it’s taught correctly.

    I posit that computer programming should likewise earn a place in the curriculum quite apart from any vocational training. Teach computer programming because – again, if taught correctly- it serves to make our students more logical and more able to problem solve.

    I think that trying to change our CS curriculum so students can remain stultified as they can get away with in math class is terribly wrong headed. In fact, celebrate they cannot escape having to think in computer science.

  4. Stephen Bloch Says:

    “Teaching syntax is easy. The kids write the syntax down in their notes or save a code snippet and they have the idea what it does. Getting from the given exercise to the point where they type relevant code is a whole different story. I cannot find a programming book that teaches that skill.”

    Many programming textbooks claim to be teaching problem-solving, but a lot of them still spend most of their time on language syntax, and the problem-solving technique is basically “Think about how you would solve the problem if you were a computer. Break it down into steps. Then break down each of these steps into smaller steps, and so on until you have steps that you can write as single lines of language syntax.” Which doesn’t help if you don’t know how you would solve the problem if you were a computer. Students can easily develop “blank page syndrome”, with no idea where to start.

    There are exceptions. Felleisen et al’s _How to Design Programs_ (first edition at http://htdp.org, second edition at http://www.ccs.neu.edu/home/matthias/HtDP2e/) heavily emphasizes a step-by-step “design recipe” for getting from an assignment to a working program. Each step has concrete questions to ask yourself, and concrete products that let you know when you’ve completed the step. The first step or two are easy enough that almost anybody can get past the “blank page” and (since I give partial credit for each step in the recipe) not get a zero for the assignment.

    About eight years ago, the lead author of _How to Design Programs_ (originally written for CS majors at a highly competitive university) asked me to write a “high school edition” of his book. I’ve never taught a high school class, but I frequently teach a college-level “programming for non-majors” class, so I aimed my book _Picturing Programs_ (http://picturingprograms.org) at that audience, and it’s been adopted at a good number of high schools. Again, the emphasis is on a step-by-step design recipe. I teach something like half a dozen syntax rules in an entire semester, but by the end of that semester students are writing video games with clean model/view separation, writing functions that operate on class objects, arbitrary-length lists, and other functions. And not an “n = n + 1” in sight.

    A possible problem: _How to Design Programs_ and _Picturing Programs aren’t in Python, they’re in pedagogical subsets of Scheme. All the principles and techniques in the books could be done equally well in Python, and I’ve done most of them in Java (where everything takes twice as much code), but I don’t know of a Python-based textbook that takes quite such an explicit approach to the steps of problem-solving.

  5. Andrew Trefethen Says:

    This is actually what i am conducting research on for my doctorate. My own programming experience was driven by the sudden power i had to do anything in the world on a computer. I actually was in a programming club before i was in a class, so there was no real structure to it (especially when everyone else quit going and i was the only person left alone on Thursday evenings to bash my head against a wall until something clicked). The key to teaching programming is as you said; getting the students to want to increase their skills. I think there is a solution, although unconventional. A teacher must abandon the idea of structured homework, it simply wont work with programming. Students gain points through participation and a final assignment which is built around a concept of partial work-ability. simply put, one part of the program will produce correct output even if another portion does not. This gives the teacher many opportunities to assign partial credit. Next, there are no lectures after the students have been taught about basic syntax and variables. Do not teach them branching, looping, or arrays. Students will ask questions when a presented task truly seems impossible. If you ask a student to print “yes” if a value is greater than 5 and print no if it is less than or equal to 5 but you have not yet taught them about if statements. then most of the students after giving it some thought will proclaim it to be impossible. This is how you create the perfect opportunity to teach them about if statements, and they will remember it because it solves the problem they have, It is easier to remember solutions, rather than tools. if you teach a concept before it is to be used then it is a “tool”, if you teach it as it is requested by the student’s, then it is now a “solution”. so a teacher must be open to a question-driven class setting and only attempt to steer the students to ask the right questions.

    • gflint Says:

      I have actually tried these approaches. They work great for students who want to learn to program. Not so great for those that are in the class because there was nothing else that fit their schedule. The unstructured homework almost guarantees half the class will do nothing while the other half does good work but sees the other half doing nothing. I have also done the “here is a problem, find a solution” approach. Again the kids that like programming excel in this approach. The non-programmers, not so much. The average kid would rather get a “C” than read the book. I love to throw a problem at a class and step back. I just do not get many classes that are capable of handling that approach. It is hard to believe but some kids do not think programming is fun.

  6. Ming Says:

    Programming problems are a little bit different from math problems in that you get more feedback on the correctness of the solution because the computer will tell you when you’ve done something wrong. Also, for more advanced programming problems, it’s possible to have solutions that are “partially” correct.

    In terms of creating easy programming problems, have you tried, “here’s some code that does X, modify the code so that it does Y?” or “what happens when you run this program?”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: