Saturday, March 12, 2011

Basic computer programming: not a 21st century skill?

In a couple of earlier posts (here and here), I lamented how difficult it is to do basic computer programming on today's computers. Commenting on one of these posts, Vlorbik adds:

in the DOS environment, one had BASIC
right there, ready to go, 
on every box on every desk.
you'd open it up, find a program that runs,
and start banging on to see what happens.
Several other commenters responded with links to free downloads of platforms for basic programming--particularly SCHEME (from MIT Open Courseware) and SciLab. While grateful for these suggestions, I haven't been able to get any of these to run on my Mac (OS 10.4.11). I haven't yet tried them out on my Windows (Vista), but since this computer is the one I use for most of my work, I like to keep the mischievous child to whom I'm trying to teach basic programming (J, of course) entirely off this computer.

Ultimately, therefore, I resorted to using with J the same built-in programming language I myself use for coding GrammarTrainer: Javascript. But I discovered last week (after a long hiatus in programming with J) that my Mac has managed (apparently while I wasn't actively supervising it) to "upgrade" itself in ways such that it's no longer possible to trick it into letting you program in Javascript. 

Earlier, all I had to do was this:  copy an html page, "view" its source code, copy this code into a text file, edit it, and save it as an html file.  But now such a file, whether opened up in Firefox or in Safari, no longer behaves like an html file, but instead gives a static display of the earlier text file with no functionality whatsoever. Only by downloading TextWrangler--suggested to me by an extremely helpful friend--was I able to bypass this problem. But why does an upgrade to my computer result in my having to download stuff that I didn't need earlier?

My new PC has also made basic programming more difficult (as well as making buttons like "save" and "refresh" less transparent for us non-visual, verbally-dependent left-brainers), but so far a special download has not been necessary. Here, it used to be possible to edit source directly from the window that pops up when you "view source." No longer. But luckily the trick that used to work on my Mac still works on my PC--for now.

The assumption by those who create operating upgrades seems to be that no one (or no one else?), at least on this side of the Pacific, wants (or needs) to do any basic coding any more. And so we're raising a generation of American STEM students that not only is increasingly dependent on things like Dreamweaver and Macromedia, but, for those few who might be interested in more basic programming, has fewer and fewer convenient venues for it.

In an earlier comment Seth, who has taught intro programming at Penn, observes one of the possible consequences of this:
It was 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. 
And as Joel Solsky observes in his blog post The Perils of JavaSchools, even in college, where Java has edged out more basic programming languages like Scheme, students are no longer learning basic programming concepts like pointers and recursion.

Personally, I love recursion. Ever since my great-grandfather had me thought-experimenting about cereal boxes whose front sides contain pictures of front-facing copies of themselves, and even more so since reading Gödel, Escher, Bach, but most especially since taking LISP in college, I've been fascinated by it.

Why is it so darn hard to teach it to my son?

18 comments:

Elizabeth said...

I like Processing as a nice, java-based programming language with a provided IDE, runs well on a Mac.

Devi G. Mazumdar said...

I tried teaching LOGO (Turtle graphics) to my kids several years ago using a free MS version. It did not evoke the same kind of emotion that I had when I first programmed a recursive function to draw cool graphics. The off the shelf graphic designers of today with point and click features and fantastic graphics was too much of a competition. Yet, LOGO still remains a magic in my mind!

blueZhift said...

I would highly recommend Python (see Python.org) for the kind of basic programming experience you describe. I like to use it for the kind of basic utility stuff that some people use Perl for. I use a Mac for development (and everything else) and haven't had any compatibility issues at all.

Niels Henrik Abel said...

If you have an old computer, I bet you could install Linux on it, if you're looking to play around with programming. It's the computer equivalent to being able to remove the back of a wind-up watch and look at its innards to see how things work.

Steven said...

Today's computers give you a lot more options than the old days. Your Mac (if it is reasonably recent) already includes both Python and Ruby -- both great languages for kids learning programming. You can either open up a terminal window to enter code or use TextWrangler's run menu (looks like this: "#!").

I don't know what's going on with your Javascript code. What you describe should work. Safari has a lot of tools to help you code in Javascript. Just go to Preferences/Advanced and click "Show Develop menu in menu bar".

For kids, Scratch is a fantastic learning tool. I would begin there: http://scratch.mit.edu/

gasstationwithoutpumps said...

I highly recommend scratch (free from MIT) followed by Python (already installed on the Mac) for teaching programming.

See my post at http://gasstationwithoutpumps.wordpress.com/2010/08/07/computer-languages-for-kids/
I have some newer related posts, but that has the best summary.

Katharine Beals said...

Thanks so much for all these suggestions! Based on these, and on some comments I got as well on Facebook, I decided to go with Python. (J has done LOGO, and is ready for something more advanced [or more basic, depending on how you look at it]). It was a pleasant surprise for me to learn that Mac includes Python. If only it also included documentation on how to use it! It took myself and a computer programming friend of mine an hour this morning to figure out about the Terminal in which it runs and how to run it there--and only after watching a Youtube video that spells things out step by step in a way that manuals never do. For those who, like me, cannot intuit these steps on their own, here's the video series I'll be using:

http://www.youtube.com/watch?v=UQi-L-_chcc

bky said...

KB -- thanks for the link to the video. Are you using the IDE that is shown in that video? Do you know of any book or website that is good for teaching programming/CS to kids of jr high age and older? How do you plan to teach your son programming? I hope you will share your ideas on this topic. It's very interesting.

Seth said...

Did I say that? I guess I did. It's true. I was so happy a few months ago when I saw that the puzzle booth at The Franklin Institute had The Towers of Hanoi.

I've been playing with LOGO a bit on my mac. For some reason I had never used it before. I quite like it, and I'm going to use it to introduce Zamira to programming, because she'll like the focus on the shapes and colors. Also it's really fun to watch the turtle move around like crazy.

I use Python most of the time these days. I still feel that the lack of dynamic typing makes it a scary language for large projects, but for smaller ones it's great fun. See here:

http://xkcd.com/353/

Python has enough functional programming stuff built in so that it's perfectly fine for teaching about recursion and so on.

I don't understand how people can not enjoy recursion. Even after all these years, when I write a tree recursive piece of code (which I still do a lot), I still think, "that's really cool".

Seth said...

" I still feel that the lack of dynamic typing makes it a scary language for large projects, "

oops, scratch *lack of*

Katharine Beals said...

Have now done the first four lessons of the video with J, following along step by step. The instructor--whoever he is!- is great, and I'm extremely grateful to him for posting these 40+ lessons. @Bky--we're simply using the "terminal" window that now appears in our Mac, which is similar to the window that the instructor uses on his pc (does that answer your question?)

Anonymous said...

No personal experience, but if I had a kid of the right age I would take a close look at racket (language) and How To Design Programs (book). Available at http://racket-lang.org/ and http://htdp.org/ respectively.

Racket is a scheme derivative and used to be called plt-scheme. I haven't used it in ages, since way before it changed names. Back then it had a nice IDE and debugger. Both of which have probably been improved. The download page indicates that both PPC and Intel versions are available for OS X.

ChemProf said...

An interesting article from David Brin, on this topic. In praise of BASIC (which is how most of Gen X learned to program, and which I taught to a bunch of appreciative third graders for GATE about ten years ago, on a roomful of nearly unused Apples).

http://www.salon.com/technology/feature/2006/09/14/basic/

Barry Garelick said...

I learned programming with FORTRAN and in a job I had in the 80's wrote some programs in FORTRAN on keypunch cards.

Actually, TI graphing calculators use a line by line programming language, so it's possible to give kids the experience of such type of programming.

bky said...

Barry -- I read the article. I didn't get the point. I have programmed in C, FORTRAN, Matlab, and Perl, but never BASIC. What does he mean by "line programming?" Does missing out on BASIC and learning C or something like that really represent some deficit of experience?

Barry Garelick said...

I've never programmed in the C languages or anything similar; just FORTRAN and BASIC. I think those two are primitive in that the programmer must think through the logic of setting up an algorithm to do a particular computation. The author, to me, is saying that C and other languages don't do this. I know that the TI graphing calculator has a fairly primitive programming capability which would serve the purposes the author is talking about.

bky said...

Barry -- he can't be saying that in C you don't have to think through the algorithm. Why? Due to what an old English professor of mine called "the doctrine of charitable interpretation". In other words, interpret the author's statements in a way that doesn't require assuming he is silly or blatantly wrong.

I think the key is the concept of "line programming". Does that mean something like if you have a shell open you enter commands a line at a time and they are executed (if possible) one at a time so you are always stepping through the code? Presumably then the shell would wait until a block of code was entered, if relevant (as with a loop or while/if statement). Why is this better for learning?

Is BASIC like that? FORTRAN isn't.

One advantage of C, as far as being "close to the machine" goes is pointers. FORTRAN originally did not have them but I think the latest version of FORTRAN does. Or not? My guess is that Python and other interpreted languages cannot have pointers. There are those who claim that having pointers is the mark of a good learning language.

So far from what I have seen of Python I like it and half-way plan to teach my 12- and 13-year olds some programming with Python for a summer homeschool project. I would like to find a source of projects. I have seen some books on Amazon that might be helpful for getting beyond the language intro that can be found in the videos Katherine mentions in the original post.

I am sure she will have lots more helpful stuff for us in the near future!

kcab said...

Wasn't that called interpreted BASIC or something of the sort? Or was regular BASIC interpreted? I know I've used a compiled BASIC before.

I've generally used compiled languages, though come to think of it, most of what I do currently is in Matlab or LabVIEW. I can't think what BASIC would offer that isn't available in C. I always felt I could get closer to the machine in C than most other languages, though this may be because that's the language I've used for device drivers.

If you've got MATLAB, you could get interpretative experience in the command window.