Wednesday, November 5, 2008

Today's computer programming: whither recursion?

Over the last few weeks I've been trying, and thus far failing, to acquire some basic programming software for my autistic son that I can run on a computer at home. BASIC? FORTRAN? Even C?

The more time I spend on this, the more I wonder how many people still have opportunities to learn the programming fundamentals that to me seem not just essential, but fun: recursion, nested loops, flow charts, logic.

Back when I was in high school, students could write basic programs directly onto their primitive home computers. What about today's high school students? How many of them are nesting loops or creating self-calling functions--as opposed to writing html tags, cutting and pasting from someone else's code, or "programming" games using high-level programs like Director?

In the course of these musings, I came across a recent blog by a Penn graduate that questions whether even college-level courses are now teaching such fundamentals as pointers and recursion.

The more today's programming limits itself to "cut and paste" and high-level parameter setting, the more we lose the kinds of flexibility and creativity crucial for novel software applications--whether for entertainment, research, or education.

All the more reason for me to track down a programming package for my autistic son, who may one day find his most promising niche in what may already be a dying vocation! Any pointers?


Kalyani said...

Have you tried Logo? You may already know of it - but MSW Logo ( is quite neat. Being a non-tech person, I found the resources they have quite useful.

cassie said...

have you tried lisp? MIT used to use it to teach their basic 'intro to computer science' class. the textbook and course notes should be available online under OpenCourseWare. The course number is 6.001.

cassie said...

actually, python is also pretty basic and easy to use.

bky said...

Is your kids in high school or younger? Then he doesn't need to worry about pointers and recursion, but sure, he needs to understand how to construct a loop and various termination conditions, sorts, and so on. There is a great programming environment for numerical calculation that also is a C-like programming language: Matlab. It turns out that Matlab is very expensive, but there is also a free-ware alternative called SciLab that works and feels much the same. SciLab and Matlab have a lot of high level math routines (calculating eignevalues, and everything else you might need to do to a matrix), which is the real selling point of it. But forgot all that. Matlab and SciLab are also easy-to-use programming languages that use syntax much like C and have all the regular constructs that you want from a programming language. True, you don't have to do everything by hand, but you can. It also has nice graphics capability so you can plot your results without having to wrangle zeros and ones. Another plus is that you don't have to compile it. The hard-core zeros-and-ones crowd will argue that since there is no compilation, we might as well be eating Twinkies and watching TV, but to learn the basics of programming, you just don't need to worry about compiling. Go Matlab (if you have a couple grand, otherwise, go SciLab).

lefty said...

Thanks for all the suggestions! I will check them out and report back.

Seth said...

oh my goodness, those comments by the Penn graduate are on-target. I felt like cheering while I was reading it. The class he is referring to, CSE 121 at Penn, is part 2 of the two-semester intro programming course at Penn, or at least it was back then. I helped teach it twice, once in 1993 and again in 2000. When I was involved in it (not that I had anything to do with the curriculum, although I thought it was very good), the course was very consciously set up to hit them with recursion right away, as he says. There were actually two reasons for this. One was because it was important to teach, for all the reasons he says. The other was as an equalizer. Some of the students in the course had had a lot of programming experience from high school, and others did not. But almost nobody had experience working with ML (OCAML) and Scheme, so everybody started off more-or-less equally that way.
What he says about pointers and recursion enforcing and testing a certain way of thinking is a very important point, in my opinion.

But what I found really disturbing from helping to teach that course was that it was possible, indeed universal, that the students who came from the best high schools and had the most experience had never been exposed (consciously) to problems of recursion. Why is it that e.g. the Towers of Hanoi problem has to wait until college to be taught? Students need to be hit with this when they're younger, before their brains start to rot.

I really wish that when people talk about the need for computer in schools, the focus would be not just on computers, but computers as a way to teach how to think about breaking up a problem. But I'm an old-fashioned fart, so I still think that one of the best preparations for programming is geometry, and the process of proving a theorem. I'm scared to ask if that is still taught in high schools.