Quantcast
Channel: [In]effective Theory
Viewing all articles
Browse latest Browse all 53

First Languages Don't Matter

$
0
0

Any hacker with his salt can debate for hours the question "what programming language should I learn first". Everyone certainly has enough practice - at least once a week, someone asks #golang-nuts if go is a good language to learn. (Well, of course we think so - try asking on #forth!) Admittedly, it's an important question: we all want first-timers to have the nicest introduction possible to programming and more broadly, computer science (because we apparently hate job security), and the natural way to do that is to start people with a language that is easy to learn, powerful enough to provide room to expand, and well-designed, so that newcomers learn the "right" abstractions.

No one of these alone will do. Languages like scratch, which are easy enough to learn (we think), are routinely spat upon and ignored, because they end up not really teaching anything. Correspondingly, one would never teach a newcomer Scala - they'd be scared away! And we all hate Java, because programmers are learning the wrong things from it.

Actually, those three criteria seem to be just about the right ones, so let me repeat them. The language must be easy to learn, so we don't discourage people and turn them away. It has to be powerful, or at least more powerful than you see at first, so that there's something there for the newcomer to explore. And it has to be well designed, with the right features and none of the wrong ones, so that sapling programmers grow in the right direction. (And for now, lets just turn a blind eye to the fact that nobody can agree on what that direction is, other than "not Java".)

Easy to learn. Powerful. Well-designed.

My first language was JavaScript.

Not that modern, ubiquitous, relatively standardized mush programmers call javascript today, running on firefox 10 or chrome god-only-knows, with a decade of optimization work behind it. No, this was ten years ago - JavaScript with two capital letters, on Internet Explorer 5.5. No concept of debugging. Worthless, or no, line information. Missing a semicolon in the wrong place? "Error: object expected." Anything else? "Error: null is null or not an object". No design consistency. The idea of validating forms was new and fancy. Objects were, if I remember correctly, called "records". My editor? Notepad.

Let's go over those three criteria again.

Easy to learn. Aha. Ha. Because nothing facilitates the learning process like ... well, any of the above, really. I can't pick just one.

Powerful. Well, it was Turing-complete, if you ignored some implementation bugs. Does that count? It wasn't "object-oriented". AJAX was a brand-new thing that nobody really knew about.

Well-designed. This might not even be a concern here - even having the wrong abstractions might have been an improvement. (Some might add that adding them, was.)

And yet, despite this horrible beginning, programming fascinated me. It captured me, more than (almost) anything else. And after months of playing with javascript, trying (and failing, and now I know why) to build bigger, better things, I moved on to C++, another language that most would say is terrible for starting, and continued the dance we all dance. Try, succeed, or don't, and move on. It's how you learn.

It's not like I'm a rare anomaly, either - if a small set of languages were better than most, you would expect them to be better at producing high-quality programmers. Most decent hackers should then be able to agree on a small set of good "starting languages". But they can't. When asked, the answer is more correlated with current favorites than anything else.

More to the point, one would expect most hackers to have come from one of a small set of languages. But again, this isn't even close to being the case. When a lot of today's most respected folk first began playing with computers, none of today's "good-for-learning" languages were even around. Is that generation worse off for it? Not really. There are more programmers being produced today, but this is a result of the ubiquity of computers, and unrelated to the types of languages being taught.

At the end of the day, all programming languages are about building incredibly complex structures on top of a simple but complex system. It's a kind of problem that fascinates a certain type of mind, but turns pretty much everybody else off. And no amount of colorful make-up can change that.


Viewing all articles
Browse latest Browse all 53

Trending Articles