Why your first programming language doesn't really matter

When it comes to learning programming, your choices are less important than you might think.

There's a lot of snobbery about first programming languages and how the wrong choice can forever saddle developers with bad habits.

This censorious attitude stretches back to the 1970s, when the father of computer science, Edsger Dijkstra, suggested that developers who learned BASIC had been "mentally mutilated beyond hope of regeneration".

Half a century later the languages may be different, but the willingness to admonish learners for cutting their teeth on "lesser" programming languages remains.

Today, it is JavaScript that is often a bête noire for those policing learning.

SEE: Hiring kit: Python developer (Tech Pro Research)

According to one recent screed against the language: "Despite how enticing JavaScript might seem, it's a siren at best and Pandora's Box at worst. The absolute lack of constraints which some people laud actually makes it one of the worst possible choices for LEARNING to program."

It is true that JavaScript is a language so janky it inspired a stand-up routine.

But the idea that the role of a first programming language is to instil a lifelong sense of good practice is wrongheaded.

Learning to code is empowering and often rewarding, but it's also frustrating and dull.

Banging your head against a wall for hours on end because your code isn't behaving as expected isn't fun.

And while learning can be enjoyable, struggling to grok poorly written documentation or grasp some new programming paradigm often isn't.

When you get bogged down you need an incentive to push through, and that's not going to come from some dry Towers of Hanoi tutorial.

What will spur you on is writing code to do something that matters to you. Maybe it's reshaping the world of Minecraft using Python, customizing a website using PHP, or scraping data that interests you from the web.

The language itself doesn't matter, what matters is that you are invested in what you're trying to do.

If you don't care about what you're doing, then your chance of just packing it in shoots up. And surely learning JavaScript, and all the bad habits that come with it, is better than just giving up on coding altogether?

This may be a separate argument, as there are plenty who say the last thing the world needs is more bad programmers. But the idea that learning the "wrong" language at an early stage will leave an indelible stain doesn't seem borne out.

Of the renowned developers TechRepublic spoke to, each began programming using Dijkstra's hated BASIC.

Generally, it was through necessity. Yukihiro Matsumoto, the chief designer of the Ruby programming language, chose BASIC, as it "was the only language my first computer, a SHARP Pocket Computer PC-1210, could run" while Alan Cox, a key figure in developing Linux, used BASIC on a Commodore Pet and TRS-80 because that what was taught by his school computer club.

Similarly, the game developer Jonathan Blow, creator of Braid and The Witness, started out using BASIC on his school's Commodore Vic-20 computers. Any mental mutilation suffered from that early exposure certainly isn't evident in Blow, a programmer so committed to writing efficient code he decided to create a language of his own.

Stack Overflow co-founder Jeff Atwood has charted his own early adventures programming in BASIC on an Atari 2600 and how that pleasure in crafting simple programs drained away upon contact with the complexity of coding in C.

"BASIC didn't mutilate the mind, as Dijkstra claimed. If anything, BASIC opened the minds of millions of young programmers," he wrote.

As Atwood points out, of those newly minted programmers "not all will be good, of course, but some inevitably will go on to be great".

So when it comes to which programming language you should learn first, the answer is 'It doesn't matter' — just figure out how coding could help you do something you enjoy, and let the language follow.

Also see

About Nick Heath

Nick Heath is chief reporter for TechRepublic. He writes about the technology that IT decision makers need to know about, and the latest happenings in the European tech scene.

Editor's Picks

Free Newsletters, In your Inbox