HTML5 Zone is brought to you in partnership with:

John Sonmez is a Pluralsight author of over 25 courses spanning a wide range of topics from mobile development to IoC containers. He is a frequent guest on podcasts such as DotNetRocks and Hanselminutes. John has created applications for iOS, Android and Windows Phone 7 using native tools, HTML5, and just about every cross platform solution available today. He has a passion for Agile development and is engaged in a personal crusade to make the complex simple. John is a DZone MVB and is not an employee of DZone and has posted 67 posts at DZone. You can read more from them at their website. View Full User Profile

What Programming Language Should I Learn?

12.05.2013
| 8192 views |
  • submit to reddit

I often get asked by beginner programmers what programming language they should learn.

This, of course, is a tough question to answer. There are so many different programming languages today that a new developer, or even a seasoned developer, wishing to retool his or her career, could learn.

I’ve actually tried to answer this question before in a YouTube video, but I want to revise and refine my answer a bit here, because some of my views have changed and I’d like to give a bit more detail as well.

112213 0123 WhatProgram1 What Programming Language Should I Learn?

The wrong question to begin with

It turns out that what programming language you choose to learn is not actually all that important

Things have changed quite a bit from back when I first started my career in software development. Back when I first started out, there were much fewer choices of programming languages and there were much fewer resources available for reference. As a result, the choice was much more important.

For example, I started out learning C and then C++. At that time, it took quite a bit of work to master the language itself and to understand all of the standard libraries that were available. A good C or C++ programmer back then had a very in-depth understanding of every nook and cranny of the language and they needed this knowledge, because of two main reasons.

  1. References were not as widely available, so figuring out a syntax or library available involved flipping through a huge book, rather than just typing some keywords into Google.
  2. Programming, in general, was done at a much lower level. There were far fewer libraries available to be able to work at higher levels, so we spent more time working with the language itself and less time working with APIs.

Contrast that with the programming environment of today, where not only is information widely available and can be accessed with ease, but also there are a large number of programming languages that we effectively use to program at a much higher level due to the vast amount of libraries and reusable components available to us today.

In today’s programming environment, you tend to not need to dive as deeply into a language to be effective with it. Sure, you can still become an expert in a particular programming language, and it is good to have some amount of depth in at least one language, but you can literally learn a new language in less than a week and be effective with it almost immediately.

Now, before your alarm bells go off and you write me off as crazy, let me explain that last sentence in a bit more detail.

What do you mean you can learn a programming language in a week?

What I mean by this is that once you understand the basic programming constructs available in just about all programming languages, things like conditionals, loops and how to use variables and methods, you can take that same knowledge to a different programming language and just learn how to do those same things in that language’s syntax. In fact, most IDEs today will even help you with the syntax part, making your job even easier.

If you are already fluent in multiple programming languages, you probably agree with what I am saying, but if you have only ever learned one programming language or none at all and are looking to learn your first programming language, you might be a little skeptical. But, take it from someone who has learned and taught programming languages which I have learned in a week, the basics are pretty much the same.

Check out this book which basically deals with this exact subject, Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages.

Now, if you are just starting out, it is pretty unlikely you’ll be able to learn a whole programming language in a week. This brings us to the question, you may be asking yourself…

So, what programming language should I learn then?

Hold up. I’m still not quite going to answer that question. Because, it still isn’t quite the right question.

Instead of getting hung up on what programming language you want to learn, you should instead ponder what you want to do.

Learning by doing is the most effective way to learn, especially if you are doing something you have an interest in or is fun to you.

So, I always start new want-to-be developer out by asking them what they want to build.

Do you want to build an Android application? How about an iOS application? A web page? A game?

First, figure out the answer to this question and then let that answer guide you to choose the technology and programming language you will use to achieve that goal.

Don’t worry so much about which programming language or technology is most valuable. You can’t make a wrong decision and regret it later, because it won’t take you much time to retool later if you need to. Once you have the basics down and have actually used a programming language to build something, you’ll find that doing it again will be much easier.

112213 0123 WhatProgram2 What Programming Language Should I Learn?

I like to encourage new developers to write a mobile application—especially an Android application.

Here are some reasons why:

  • A complete Android application can be built by a single person. Creating a complete application will really help you to feel confident about software development and is one of the best ways to really learn to code. I spent a good deal of my early career only being able to create bits and pieces of things, and it was frustrating, because I never knew if I could really “code.”

  • By learning Android, you learn Java and how to use libraries and APIs. This will give you a good programming language to start with and you’ll get some valuable experience with APIs.

  • Google gives you some free help and makes things pretty easy to learn. Since Google really wants you to create Android applications, they have put quite a bit of work into creating easy to use tools and tutorials to help you be successful quickly. (I’ve also created some tutorials, which you can watch at Pluralsight here as well.)

  • You can actually make money while learning and teach yourself a very valuable and upcoming skillset. Not only can you sell your Android application or monetize it in some other way, but you will be learning a complete set of software development skills for a platform that is in very high demand.

Aha! So Java it is then?

No, not exactly.

If you had to press me hard for a programming language suggestion for someone just starting out, I would actually suggest JavaScript.

It is no secret that I have a sort of love / hate relationship with JavaScript, but I would be a fool, and doing you a disservice, to tell you that it is not one of the most valuable programming languages to learn today.

JavaScript may not be the most pretty or elegant language, but it is everywhere and it appears that despite my best efforts to stop it, it will continue to grow and spread for at least quite some time.

If you learn JavaScript, you’ll be able to create applications in many different spaces. Mobile, web, and even robotics can be programmed using JavaScript. And, although I was quite skeptical at first, HTML5 game programming with JavaScript is actually quite good. I created a Pluralsight course on creating an HTML5 game using JavaScript, and I have to admit that I actually really enjoyed the experience.

Summing it up

So, just to be clear. My recommendation is that you focus on what you want to build and let that guide your technology choice, with a slight biased toward Android development, because of the reasons I outlined above. But, if you absolutely want to choose the most valuable programming language to learn, at least at the time of writing this post, it is definitely JavaScript. Like or hate it, it is used everywhere.

I’m actually working on some products to help developers manage their careers and lives better which will cover topics like this one a bit more in-depth. If you are interested in receiving some updates when I publish an interesting article or video, or when I launch some of those products, feel free to sign up here. Don’t worry, I won’t spam you.
Published at DZone with permission of John Sonmez, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Robert Brown replied on Wed, 2013/12/11 - 1:42pm

I heartily disagree with Javascript as a language to start with.  It's far too flexible and too wishy washy, which means doing enterprise level coding with it becomes something that needs to be done in a very disciplined way, and the language doesn't give you any hints as to that discipline.  

Learning javascript first can lead to a lot of really bad habits such as:

All code is global.  There is not much of a reason from a language structure standpoint to learn scoping and encapsulation which means you get into a bad habit of using everything in global scope, then when you are writing your first java app, you wind up making everything static because you can't figure out how this public/private/local scoping works.  

Method signature means nothing.  Since any method can have any number of parameters, there is no such thing as a signature, which leads to code like this... (note I have seen this code many times in javascript)

doSomething = function(){
   ....

   arguments[0] ....
   ....
}

doSomething("pass in parameters where you have to know in depth detail of the function to figure out")

Which when you apply that to java or most other languages it becomes...
public doSomething(Object[] parameters){
   ....

   parameters[0] ....

   ....
}

And now understanding the system just became that much harder to understand.  

Nope, its far too easy to pick up bad habits in javascript when you don't know anything.

I'd say start with a Typed and Scoped language of some kind, then you will be on the way to getting habitualized into thinking of code as blocks of functionality that can be tested and confined instead of wild west spaghetti.  You'll still pick up bad habits but at least a few fundamentals are better enforced.  


Antonio Sobalvarro replied on Wed, 2013/12/11 - 4:37pm

Excellent article !! 

I agree with you, specially that today IDE´s allow programmers to focus more in logic than in syntax.

I would like to suggest to start with C++ or Java with emphasis on object oriented design (class, inheritance, polymorphism).  Netbeans or Eclipse will be a nice IDE choice.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.