Computer Science Before Programming

For most people the first real computer science course is introduction to programming. It may be called something else but effectively what it is is a course that teaches programming. Along the way concepts like encapsulation and abstraction are also taught and, hopefully, learned. The new CS Principles course reduces the emphasis on programming – in theory at least. I’m curious to see some good scope and sequence documents to see how it is working in practice. Likewise the Exploring Computer Science curriculum includes programming as only a part of the overall curriculum. In fact web design is the third major using with programming the fourth. This seems to be a trend.

Time will tell if this breath first approach is the way to go. I have mixed feelings myself. I do like the idea of teaching concepts without having to teach programming at the same time. Teaching a programming language, especially one involving real syntax, at the same time as introducing theoretical concepts can  be daunting. I see that a lot of these new courses use tools like Scratch, Alice and Kodu rather than more traditional languages like Visual Basic, Small Basic, C/C++/C# or Java. This does reduce the programming syntax complexity somewhat. There are also great non programming resources like CS Unplugged and I am a huge fan of them. I especially like that they get students up and moving in many cases.

Many of us struggle with the idea that we were taught one way and so want to teach others the same way. We may not always admit it but that drive can still be there buried under an excitement over new tools. I think I am past it. On the other hand I also want to move students beyond the post syntax tools into “real programming languages.” A lot of people start a course with Alice/Scratch/Kodu and then move quickly (for various definitions of quickly) into other programming languages. Sometimes in the same semester or quarter and sometimes in a second course. With a good base in concepts this is not usually as scary or as difficult a move as one might expect. The two keys are the previously mentioned core concepts and a real enthusiasm for the subject. I found that if students became really interested in solving problems, usually because they found relevant (to them) problems to work on they were down right aggressive about wanting to move to some “next level.”

The question becomes how large a jump should that next level be? Should you go from Scratch right to C++? Ignoring the fact for a minute (or longer) that some advocate starting with C++ (I don’t) or even Assembly (hard to believe for true) I like the idea that easing students into things is a good idea. My current thinking is that Small Basic is a good first step into programming languages with syntax. Why? A couple of reasons but one is that the syntax is still easy as is the IDE. Another is that the path to Visual Basic, a serious professional development language and IDE) is pretty smooth using the “graduate” button/feature that is built into Small Basic. Other people will want to move right on to other languages and that is ok I think. It is important though that the material continues to be interesting. Students will work hard at fun but hard work for the sake of hard work is no fun at all.

The most consistent predictor of success in second and later courses (I believe and wish I had real data) though is a grounding in the concepts. A student who understands how a loop works will have an easy time picking up the syntax of a new programming language. This is where graphical tools like Alice, Scratch and Kodu do make life a little hard on teachers because they mostly hide the constructs that make things like loops work. Oh you can look at them and it gets easier with Alice 3.0 where you can see real Java code. But students have little natural incentive to do so early on. This means that teachers need to make sure they cover it and make sure that students really grok it. There is more to understanding a loop than “between here and here things will be repeated x number of times.” You can teach that loop without programming though. I love the climbing stairs example.

  • Are you at the top?
  • Move up a step
  • Repeat until “at the top” is true

One can see the loop in Scratch (to pick on one) but that is not the same as understanding that a loop works with a setup, an action and a check to see if the action means that the loop is done. So what you can, and perhaps should start with the concepts before teaching programing at some point you’re going to need the programing. Let’s make sure that students find meaning in the code though.