Variables Late or Variables Early?

One of the shining stars of teaching computer science in recent years is the Alice environment. There is some early research and many anecdotal tales of great success using this tool for teaching beginning programming. I must admit that I like it myself. It is friendly and powerful. I especially like the story telling possibilities as I can see them attracting a lot of people into doing interesting things with programming.

At this year's SIGCSE there was a cautionary note sounded in one paper though and I think it is worth thinking about and discussing. The paper is called Through the Looking Glass: Teaching CS0 with Alice. Now the paper is far from all negative but it does raise a number of interesting points worth considering by teachers planning on using Alice.

One of the concerns is that Alice allows teaching variables late in the learning process. This is different from the normal way of doing things. In the past variables were generally introduced at the very beginning of a programming course. Typically one creates an expression using a number of variables and displays the results of the expression. This is about the first thing done. With Alice though very interesting and powerful things can be done without using any variables at all.

In fact using variables is somewhat complicated. Not complicated in an absolute sense but complicated compared to other things in Alice. Without a book I confess that I struggled a bit figuring out the combination of creating, initializing and using variables in expressions. Once I had it down teaching it to others was easy but still not so intuitive as other features. But what does that mean?

According to the paper some of the students who learned Alice first had some trouble with the concepts and use of variables - if not in Alice than in what ever language (usually Java in this case) they learned next. I suspect that this problem exists in other similar tools to some degree.

When I learned Scratch in a workshop they did cover variables early on. I grasped them easily though if that is do to a) good teaching b) a better interface for variables or c) having already learned my way around because of AliceĀ  I am not at all sure. My hope is actually that it was because of good teaching because good teaching is less painful as a plan for reproducing success. But still some of the concerns expressed about Alice also seem to apply to Scratch.

I think that variables are a very important base concept in computer science in general and programming in particular. I think that teaching variables early is the way to go. I think that Scratch has a small advantage over Alice here BTW. The domain of possible applications is broader with Scratch than with Alice and that lends itself to more interesting variable related projects earlier in the cycle. At least that is my current theory. I'd love to discuss that with others who have tried both tools.

One last word, I do worry most about the jump from simple, easy to use and learn programming environments to the next level (programming with standard programming languages) of programming. That was an issue back in the day with Logo and it remains an issue with tools like Scratch and Alice. They are great at what they do but how do we make the move to languages like Java, C#, C, C++ or Visual Basic smoother and easier for beginners? Now there is a question!

Technorati tags: CS0, CS1, Scratch, Alice, SIGCSE, Programming, Education

My site was nominated for Best Education Blog! Please vote!