Friday, September 15, 2006

Why Johnny Can Code

This is in response to the article Why Johnny Can't Code , over at Salon Tech.

I have heard several people already agreeing with the arguments against this article, so I know I am not alone. Although I completely agree that it is a very good thing for kids to have a quick and easy way to program on their computers, should they have the curiosity, I do not believe the author made very compelling points on the use of BASIC, or anything resembling it. Particularly, I think the author has far too high a reverence for BASIC and fails completely to see the damage the language can do to an aspiring developer, which I won't go into in this article. Conversely he seems to find languages that could fill the gap he says, namely Python, as somehow wrong for a job, which is entirely an incorrect idea. This is pointing from multiple vantages as being written by an unenlightened developer.

Yes, a fundamental understanding of how software works can be a good starting point for a life of technology as a hobby, career, or even just what burns the weather forecast into your toast. Love it or use it, technology with a background is more meaningful. In the past, this was intrinsically bound with BASIC, but that doesn't and should not hold true today. We have moved on out of more than disdain for our old friend and enemy. We have learned better.

Very quickly does the author of the original article mention and pass over Python and Perl as alternatives that don't mean some non-mentioned requirements for the job that BASIC filled in the past. Mentioning of putting his son to C++ after finishing with BASIC make me think that he is not a fan of this class of languages. There is some missing opportunity here, obviously. If he had brought his son to Python, rather than buying an old Commodore 64 out of frustration for finding a good BASIC interpreter for a modern OS, his son could have moved directly to more complex programs in a "basic" language, instead of learning to write the same "basic" programs in a complex language. Python is a fantastic educational language, but shines equally well when scaled to professional usage, which eliminates the bridges needed to cross from one language to the next through the levels of one's programming education.

Some shred of truth found, however, is the problems with bringing a language to the forefront of education in the was BASIC once was. There are too many languages that would argue they are superior. I will not deny that I think none of them old a flame to Python, especially in this context. However, I know I will be debated on this point. The fact remains that BASIC was a bad language, which served a purpose well, but has seen its day and is obsolete for a good reason. We have better ways of doing things, and that doesn't have to mean more complex languages, simply better languages.

David Brin , thanks for wrapping up Foundation , but look into the gaps in your logic about educational programming please, for your son's sake.

5 comments:

kabalweg said...

Java or C++ can be a good programs for starters too...
Basic has its days already and it maybe obselete this days.


KaBalweg
Free Source Codes and Tutorials

kipbot said...

Others have weighed in on the virtues of BASIC as a way to get people hooked on hacking: Neal Stephenson in In the Beginning was the Command Line and recently Linus Torvalds said he dug BASIC in the past. http://www.codinghorror.com/blog/archives/000648.html

Anonymous said...

Ah, BASIC. Life was simpler back then. I had long hair and listened to rock and roll. Now I have no hair and can't hear anything. (Ok, perhaps a slight exaggeration.)

Anyway, back in the day, BASIC was a fantastic program to learn to code with. Of course, "real" programs -- to me, back then, that meant games and business applications -- were usually programmed in something else. (On 6502 microcomputers, that usually meant assembly language.) Thus, BASIC might have taught you some things well (what a subroutine was) and some things badly (what GOTO meant.)

Now you need to know HTML, CSS, Javascript, JSON, XML, and browser incompatibilities to code a website. And that's just the client side. You probably also need a server side language (Java, Python, PHP, Perl, whatever), all of that baggage, and probably SQL. Maybe a little LDAP, maybe some HTTP, maybe some SOAP or XML-RPC. All fun stuff.

So Calvin is right. The BASIC era is over. It was fun while it lasted. But Python is the new Pascal in terms of a instructional programming language, but with one important difference: it's deep and wide. So you can play in the shallow end and only move out further when you're ready to swim underwater. Going further, it can be used for high-performance, enterprise-class software (Google, anyone?) and still look like pseudo-code. Going deeper, some parts are modelled on LISP, the grand-daddy of brainy languages. And all you need to do is download it from python.org and run it. It's interpreted, just like BASIC.

The only real downside is the indenting. But after you get used to it, it becomes its greatest feature. (Just be sure to always use either tab or spaces to indent, not both.)

(and by the way, it's BASIC, not Basic.)

-jamie

Rob said...

It is definitely true that Python is used for serious work, as a quick glance at the available standard and third-party modules will show. Python is used for everything from game programming (Pygame, PyOGRE, Panda3D, PyOpenGL) to scientific (SciPy, MayaVi, etc.). However, Google mostly uses Python internally and not for the actually web-facing stuff. Supposedly that's mostly C, Javascript, and Java. I would also like to emphasize that there IS more programming out there than just web stuff. Frankly, I would much rather use something like a wxPython GUI with asyncore/asynchat/Twisted than the "Web 2.0" stuff. It's still a portable solution, although not as ubiquitous as a browser. But then again, a *standards-compliant* browser isn't exactly ubiquitous anyway.

I used to love BASIC, but I'd never go back to it after using Python even if you paid me. The fact is that BASIC doesn't generate enthusiasm anymore for me, because I used to be proud about making a todo list program in DOS with BASIC. Back then, programming anything at all was sufficient geek-cred. Nowadays, I'm writing small client/server apps in Python in less than 100 lines of code complete with a GUI, and anything less isn't interesting. The bar is set higher than it was, and quite frankly BASIC is a waste of time for those who want to do anything worth getting excited about when writing their first programs. The small BASIC programs written that would prompt for the user's first name and then print it out backwards on a DOS prompt is no longer impressive. I believe the Salon.com author is shunning reality for nostalgia.

Paul Boddie said...

One sees this kind of enthusiasm for BASIC all the time in certain technology communities - usually the ones involving people with an overdeveloped sense of nostalgia and with little idea of more recent computing developments, although at least the author of the article is aware of Python and Perl. However, the author fails to realise that even half-decent BASIC implementations deprecated line-oriented development (and it should be noted that assembly language programs are typically label-oriented instead of being structured through archaic notions of explicit statement numbering) and many imported control-flow concepts from languages such as Pascal in order to do so.

Of course, the term "half-decent" is about as generous as one can be with BASIC. Sure, dynamic languages don't expose beginners to statically allocated arrays, pointers to special regions of memory, or inline assembly language. However, the lack of emphasis on established programming concepts and practices that a heavy introduction to programming via BASIC would entail is arguably more harmful than an initial lack of exposure to things like machine addresses, machine language and memory-mapped hardware.

The author would do his son a favour by introducing him to dynamic languages and functional programming, especially since the best computer science courses (assuming his son takes that path) will probably be using such tools to undo whatever bad habits that BASIC-plus-C++ education has encouraged.

I write here about programming, how to program better, things I think are neat and are related to programming. I might write other things at my personal website.

I am happily employed by the excellent Caktus Group, located in beautiful and friendly Carrboro, NC, where I work with Python, Django, and Javascript.

Blog Archive