Johnny just doesn't want to code

| 5 Comments

Slashdot got some controversy going with this semi-hysterical look at kids programming. The gist of the article is that we may end up doomed because we don't have good line programming languages like BASIC in popular use anymore. This part should be enough to explain to everyone where the author is coming from and why he is barking up the wrong tree:

Meanwhile, the same guys were offering -- at the fourth layer -- a programming language that folks could use to create new software of their very own. BASIC was derived from academic research tools like beloved old FORTRAN (in which my doctoral research was coded onto punched paper cards, yeesh). It was crude. It was dry. It was unsuitable for the world of the graphic user interface. BASIC had a lot of nasty habits. But it liberated several million bright minds to poke and explore and aspire as never before.

The "scripting" languages that serve as entry-level tools for today's aspiring programmers -- like Perl and Python -- don't make this experience accessible to students in the same way. BASIC was close enough to the algorithm that you could actually follow the reasoning of the machine as it made choices and followed logical pathways. Repeating this point for emphasis: You could even do it all yourself, following along on paper, for a few iterations, verifying that the dot on the screen was moving by the sheer power of mathematics, alone. Wow! (Indeed, I would love to sit with my son and write "Pong" from scratch. The rule set -- the math -- is so simple. And he would never see the world the same, no matter how many higher-level languages he then moves on to.)

There are many problems with this article, and they are the sort of thing that might be taken seriously by those who know jack about programming, so let's get started...

First of all, line programming, with its love affair with goto can be just dangerous. Old BASIC is notorious for its use of the goto command, which allows you to arbitrarily jump between sections of code. When used improperly, a goto will result in you jumping to a section of code that can, in that context, cause things to go wildly out of control very quickly. Any remotely intelligent programmer breaks down any task that might have to be repeated into a separate subroutine (function or method, whatever name you prefer). The reason why this is done is that it's the only flexible and intelligent way reduce complexity.

The author is quite incorrect about Python, and no one in their right mind would recommend that anyone start out learning how to program with Perl unless their goal was to discourage someone from programming because of its learning curve. Python has an interactive shell that compliments its interpretter, allowing people to run small snippets of code without actually running the whole script or program. Not only that, but it is very good at isolating defects in the code, a definite benefit for an easily frustrated student learning to program.

It's been a while since I have done anything with BASIC, but consider this VisualBasic statement and the equivalent statement in Python:

Dim x as Integer

x = 1

That was the VisualBasic version. Now, here's the Python version:

x = 1

Now, consider the following example of the Fibonacci Sequence written in Python:

a = 0
b = 1
while b < 500:
sum = a + b
a = b
b = sum
print sum

I can't think of a simpler way for a child or adolescent to algorithmically express the Fibonacci Sequence short of writing it out in pure English. Python is on many levels the new BASIC, but when used properly, it is significantly more powerful. Unlike BASIC, Python is a very flexible, standardized language with a robust library included with its intrepretter that allows people to write useful stuff with a minimum of effort compared to other languages. Google, for example, makes heavy use of Python for their products.

Now, why are students arguably less involved in software than they used to be? I think there are a few good reasons:

  • Doing cool stuff is in some ways harder because the bar for what is cool has been set higher by modern advances.
  • Modern languages are easier in some respects, but harder. Java, for example, is geared much more toward someone wanting to write "serious" software than a language like BASIC which is better for quick and dirty projects.
  • Lower standards, anyone? The education system has reached an abysmal low and students are caught between the low and rigid standards and bureaucratic nightmares like "No Child Left Behind."

For those that want to program before they get out into the "real world," there has never been a better time than the present. It wasn't possible to create a simple game in the early 80s using a very high level language like Python, but it is today. The work that would have required long hours of learning assembly language and C can now be done in a few days of learning Python and some basic OpenGL. You just have to get used to the fact that programming is has become a much more common skill than it was 20-25 years ago and fewer people will be wowed.

5 Comments

I agree. I occasionally program in VBA (in excel), but it is always painful.

I would never teach my kid to program with BASIC. My experience with BASIC was with VB 4.0 and then with, IIRC, TrueBASIC. The stuff never sat well with me, though VB.NET is a tremendous improvement. Python is just so much better and easier than BASIC that it's sick to see someone so clueless that they'd call Python unaccessible to young people. It even has a full C API for plugging in C and C++ libraries so you can do useful stuff with it, even stuff like OpenGL game design in Python.

I strongly disagree. Reread the article. He's talking about children learning to program, not writing commerical apps. He's talking about not abstracting so far from the hardware that you miss the details about what the computer is doing. I write in Ruby/Python all time, but they are not suited for beginners.
People just starting to program are greatly benifited by using a language is that is more 'Wordy', It makes things clear. We have moved beyond basic because we're experienced and have outgrown that language. But think for a Minute about what those of us who learned on basic have gained. Also, your comments about the Goto statemetn is pure non sequitur. Goto being the root of all evil in basic is just not the case. sometimes its very usefull. anythign good thats abused is bad. Writng clean and readable code is just not in the intrest of the beginner. That desire comes with experience.

I'm not saying that these languages are inherently horrible and are going to teach kids how NOT to be a programmer. I was pointing out that other languages like Python in particular are very good to start out with, despite the author's assertion that Python is completely inappropriate for beginners. I can't count the number of times that I have been able to use Python-based pseudocode to successfully explain things to people :)

BASIC has value as a beginner's language, but I think it has been supplanted by more advanced high level languages like Python and Boo which have the advantage of being able to tap into a very powerful set of libraries so that the kid or teen doesn't have to learn a new language later on to do cool things.

And... the reason I brought up gotos was to point out that there is a definitive downside to some of what these languages can teach. I remember trying to learn C at 12 years old (my first language) and the goto keyword felt... wrong... like it was something you weren't supposed to do like playing mumbly peg with a rusty pocket knife...

The goto is so misunderstood.
In this case it even reflects what the assembler code is doing so for introduction to how the low level code does it, I find it ok.

Leave a comment

March 2010

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Recent Entries

The three purposes of the federal income tax law
Businesses will spend about 3.4 billion man-hours and individuals about 1.7 billion hours figuring out their taxes this year.…
Progress of a different sort
You know we have reached a level of decadence seldom seen in the history of the West when our women…
And police wonder why the public rarely trusts them
But there is some good news to report here, too. The Maryland state law, as noted, is the first…

Subscribe

Advertisements

OpenID accepted here Learn more about OpenID