This letter is associated with the following article:
Letters
Thursday, September 14, 2006 12:00 AM

Why Johnny can't code

BASIC used to be on every computer a child touched -- but today there's no easy way for kids to get hooked on programming.

Read other letters about this article

  • Thursday, September 14, 2006 11:11 AM

    Perl fills the bill

    perl -we 'print "Big Tits" until 1==0'

    Perl seems to fit the bill, since it can be as simple as you want and doesn't even have the type issues Basic has. It's ready when you are to step up to object oriented programming but you don't have to start with it.

    Object oriented perl is a wonderful way to learn objects. Wait don't scream. I said "learn". I'd been object oriented programming for years in Java and other languages. But I truly did not understand how all the pieces worked till I wrote perl objects. In perl it's like one of those "visible man" models. You learn how inheritance works. You learn how binding of an instance to a class works. You understand closures for the first time. You understand how the namespaces are kept separate and how instance memory is allocated. It's not just some voodoo that simply works, like in JAVA. Moreover all of the voodoo is not out of reach but right there for you to mess with. An instance can change it's own inheritance if you want it to. An instance can create a new method and write it into it's own namespace if it wants to. An instance can trap calls to it's own methods and redirect them or intercept calls to methods that don't exist and respond to them.

    Those features are not unique to perl (for example pyhton implements objects identically to perl). The difference is that All of that object management occurs in perl itself and is not hidden behind syntactic sugar (like python and java). You quickly appreciate what dereferencing costs, etc...

    The other thing that is nice about perl for learning is all of those prefixes like $ @, and so forth. They may make perl look like cursing but they force you to think about what a variable is. When I index out an array, I get what? an array? no I get a scalar, so $X[2] is how I index @X. You can look at someones perl program and if it's written well tell what every word is. You cannot look at a bare name in python or java and tell if it's a method, an array, a hash, a scalar or reference. Perl you can. (Oh and by the way let me explode a perl/pyhton myth. python has more special markup characters in use than perl, the main difference is that in python they are suffixes instead of prefixes and are overloaded with multiple meanings--try counting how many modifiers there are some time (e.g. () , [] ** and so on))

    Now once you learn perl objects. Well it's time to put down the perl and back away slowly. Python, java are much better languages for writing re-usable, easily read, complex object oriented programs. Perl is still a much more powerful language than either. But it's powerful for efficiently creating compact or single use programs quickly. Not for well designed complex systems.

    It's the perfect entry level language. And it's also something you'll use your whole life for quicky scripts.

Most Active Letters Threads

523

The crazy, irrational beliefs of Muslims

Tom Friedman explains the real problem: stupid Muslims think the U.S. is about war and aggression.
426

A key British official reminds us of the forgotten anthrax attack

A vast array of establishment and expert sources do not believe this episode was really resolved.
415

The face of rotted Washington

Evan Bayh demands more debt-financed war - fought by others - while boasting that he's a stern "deficit hawk."
210

Is Obama's civil liberties record understandable?

Was it unreasonable to expect him to adhere to his commitments regarding the Constitution?
185

Bigotry wins in Switzerland

By voting to ban the construction of minarets, Switzerland apes the most extreme intolerance in the Muslim world

View all »

Letters Help

Currently in Salon