QOTD: Was teaching kids BASIC as a first programming language really fatal?

Dijkstra once famously claimed (well, perhaps not anymore, since fewer and fewer learn BASIC):

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

The question that I asked myself last night: “Was Dijkstra right?”

I must admit, I’m one of those guys who learned BASIC as a kid, and then later went on to study computer science, get a couple of degrees, and proceed to make a pretty decent living writing what I hope are good programs. Am I just “practically impossible”? The exception that proves the rule? Or was something else at work here.

I’ll submit that Dijkstra was wrong (although I’m going to provide nothing more than simple gesticulation to back this idea up). It is certainly true that the vast majority of people who picked up BASIC as a first language never progressed beyond being anything but the most dreadful programmers. I suspect, however, that is true about almost any skill. I never became good at roller skating. I don’t possess anything but the most rudimentary skills at drawing. My ability to play the piano is limited to halting walks up and down the keyboard in tuneless exercises.

Peter Norvig has an essay about learning to program which I think hints at the fallacy in Dijkstra’s famous claim. It takes a long time to learn to program, and you have to start somewhere. You learn to program by doing, and for a short generation of programmers, the most accessible entry point was through the BASIC interpreter that came on their Apple II, their Atari or their Commodore 64. A kid with no understanding of programming could noodle around, flailing miserably, writing silly and bad programs, and most importantly figure out that he liked doing it. He could begin to read other people’s programs, and improve. He could even ultimately graduate beyond the world of BASIC, and move on to different ideas.

Dijkstra was in some sense right, but missed the forest for the trees. To get kids to learn programming, you have to get them programming. I pity the poor kid who tries to learn C or uses Visual C# as a first language. Today, languages like Python or even Perl and PHP would take the place of BASIC, and by virtue of their more powerful datatypes and structuring, generally are better choices for the beginning programmer. Yes, we see lots of really bad code written in all these languages. But from the din of mediocre achievement (itself not totally without value) a few scattered diamonds will form.

What’s your take? Was BASIC your first language? Did you turn out to be an okay programmer?

[tags]Programming,Dijkstra,BASIC[/tags]

Addendum: Interesting notes on the acquisition of expertise.

One thought on “QOTD: Was teaching kids BASIC as a first programming language really fatal?

  1. Julian

    BASIC was my first language, and yet I think I’m an okay programmer. Dykstra has a point: when I was first introduced to a “real” programming language – Pascal – I just didn’t grok functions at all, and proceeded to write monolithic Pascal programs. I know, this sounds laughable; chalk it up to whatever mental damage Basic inspired. At the same time, he’s wrong: I wasn’t permanently harmed and once I figured functions out, I regenerated the damage. I think it’s really just about learning new ways of programming, and Dykstra was just exaggerating.

    You could always up with other inflammatory statements. For example: given Java is often a first year programming language nowadays, is it possible to teach good programming to students who’ve done nothing but (probably poor) object oriented design?

Comments are closed.