Image credit: flickr/Ian Brown Many developers feel this is the language to start with

Earlier this month, ITworld blogger Matthew Mombrea wrote an interesting post about which programming language is the best one to learn first (his choice: Java or C#). Not surprisingly, it generated some great discussion, as did his follow-up post about why he doesn't recommend JavaScript as a first programming language. Since this is a question that often gets debated, I decided to see if I could divine a general consensus among developers about which programming language is the best one to learn first.

I looked at the answers offered in a dozen articles, such as the comments on Matthew’s posts, and the responses to the questions on such forums as Quora and Stack Exchange. The full list of sources I used is at the end of this post. For each one, I only considered answers that suggested a single language (ignoring the “it depends” answers, or ones that offer multiple languages). I then totaled up the number of times a language was suggested as the best one to learn first, also adding up votes that answer received from readers (all of the sources I used allowed people to vote answers up or down). In the end, those dozen sources gave me a little under 500 votes.

Based on the votes I counted, these were the three clear top choices for best programming language to learn first:

3. JavaScript

JavaScript was singled out for providing a good grounding in basic programming concepts and for its simplicity.

“... JavaScript is an excellent engine for playing around with dynamically and learning general concepts that apply to many other languages (things like variables, objects, strings, functions, etc.).” chaiguy

“I see JavaScript as the modern equivalent of BASIC. ...because of its simplicity, it is a great language for learning fundamental programming concepts.” Greg Brown

It was also cited as a good choice because of its forgiving syntax.

“The loosely typed nature of JavaScript makes the syntax somewhat more forgiving than traditional OOP languages, but most of the syntactical rules are similar enough to C++ or Java that a transition to the more formal languages wouldn’t be too difficult.” Brian MacDonald

Finally, people voted for JavaScript because of its ubiquitousness these days and the fact that you can use it for some many things.

“Alongside html and css you can create any sort of website/webapp. Because of Phonegap you can use it to create mobile apps for Android, iPhone/iPad, and Windows 8. And using Node.js you can write all your server side code. You can literally create all relevant software with javascript (along with some html/css). It is absolutely the one programming language to learn. No question about it.” i_drift

2. C

At the other end of the spectrum, many voted for C, despite some of the difficulties in using it, because of the solid foundation it will provide and that it will make learning other languages easier.

“If you want to build a solid foundation from the beginning, go for C.... Introduction to the concepts of pointers and raw memory management will be invaluable later in your career.” MM01

“Its basis of a lot of other languages. The computer equivalent of Latin. Once, you learn C the other languages are easier to pick up.” Alan Cohen

“I feel like learning C is like learning to drive on a manual transmission -- once you get the hang of it it really isn't that hard, and once you're good at it you'll be confident in your ability to drive any car any time.” John Biesnecker

Many also felt that trying to learn C was a good way to find out right from the start whether you’re cut out to be a programmer.

“If people get scared of programming with C, then they are not meant to be programmers.” luis.espinal

1. Python

Based on these data, though, Python was the clear top choice for the best programming language to learn first. The low barrier to entry and ease of use was the biggest factor, with many feeling that it will help keep people engaged and excited as they begin to learn programming.

“I would recommend to start with a "dynamic language" such as Python for your first language. You can get started easily and immediately build something that is actually usable. This is the crucial factor in learning to program. If you see immediate results and progress, you will be motivated to continue.” Sridatta Thatipamala

“Python, because you do not need a compiler and it's very VERY easy to run your programs and test.” timgray

Like JavaScript, Python was also chosen because its simple and flexible syntax.

“From my experience I feel that Python is an invaluable tool for beginning programmers, as its relatively simple syntax allows the novice to focus on programming concepts rather than fretting over semicolons and braces before her Hello World program will even run.” Frank Harvey

“I know python is very different, but it avoids having you to learn stuff which is specific to a language in particular, like compilation, includes, headers, compilers, IDEs, etc.” jokoon

“... I think Python is better for newcomers because of its emphasis on consistency and readability.“ Christopher Lin

Finally, Python was also credited with teaching good programming fundamentals.

“Python teaches essential indentation habits to newbies, which is great. I think any language with mandatory indentation is good for new programmers.“ Thomas Eding

Beyond these top three choices, the rest of the top ten were: 4. Pascal, 5. C#, 6. Scheme, 7. Visual Basic, 8. C++, 9. Assembly and 10. Scratch. However, the vote totals after the top three languages were too small, in my opinion, to put too much stock in them.

There you have it. Python seems to be the way to go if you’re starting to learn how to code. Anybody disagree? I’m guessing, yes...

Sources:

What's the best programming language to learn first? (ITworld)

Why I don't suggest JavaScript as a first programming language (ITworld)

Which programming language should newcomers to coding learn first? (Quora)

What is the best first programming language to learn? (Quora)

What's a good first programming language to learn? (Quora)

Which programming language should I learn first? (Quora)

Programming languages: Which ones should I learn first? (Quora)

What is the best order in which to learn all the popular programming languages? (Quora)

First language to learn (Stack Exchange)

Good First Programming Language (Stack Overflow)

Which Language Should You Learn First? (O’Reilly Programming)

Which Programming Language Should I Learn First? (Lifehacker)

Read more of Phil Johnson's #Tech blog and follow the latest IT news at ITworld. Follow Phil on Twitter at @itwphiljohnson. For the latest IT news, analysis and how-tos, follow ITworld on Twitter and Facebook.