learning to ride a bike

What Programming Language Should I Learn?

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. J

  • SomeGuy

    I would disagree that javascript is the right recommendation here. Perhaps for a web developer that will spend their entire life in html/css/javascript sure but any C based language is a better suggestion for everyone else. Whether it’s C, C++, C#, Objective C, PHP or Java, it will give you the foundation that most modern langauges are based on.

    • An0nym0usC0ward

      Idunno … maybe your opinion is based on somewhat outdated knowledge about JavaScript. JavaScript has since long escaped the browser. People write servers using node nowadays, and JavaScript is the DDL/DML/query language of some highly popular NoSQL databases. There’s even a recent development of an Arduino alternative programmable in JavaScript.

      I would have said the same at first thought. But on a second thought, JavaScript’s nicety is that it lets you exercise both structured, OO and functional programming at once – and all of them in a quite basic and constrained way, so that syntactic sugar, language richness or library size get out of the way.

      After having groked the basic concepts of each paradigm using JavaScript, you can try your hand at C++, C and Lisp for a better understanding of each paradigm – but your abiity to grasp the essential language features in each case will be already highly improved, compared to a bloody beginner.

      After having tried out C++, C and Lisp, you’re IMO well equipped to try out Python or Scala, or more specialized languages like Erlang or Haskell, without any of them likely to introduce you to concepts so alien they’re too difficult to grok.

      If you start out with C or C++, you’re likely to become a low level performance freak. I’ve seen many of those, and they hurt. They never seem to quite get it that maintainability and readability also count, that there are orthogonal concerns to spent processor cycles, such as reliability and security, and that performance is a not so large area of concern in an age where hardware is cheap and redundant operation is increasingly the norm rather than the exception.

      If you start out with a language so flexible and versatile as JavaScript, and work your way up into more specialized languages, you’re IMO more likely to develop a habit of always looking at the whole picture, instead of just the few aspects your first contact with a programming language taught you.

      • SomeGuy

        It has it’s place but it lacks a lot of structure. For learning that is not a good thing as it leads to bad habits and poor code. Coming from a C based background you will be able to pick up JavaScript and do it effectively a lot easier than the other way around. Also if you look what most schools are using in their computer science programs, it’s still primarily C++ or Java.
        I would not call any of the main C (C, C++, C#, Java) languages specialized. They are widely used in more industries than you will find JavaScript. Yes in the consumer market JavaScript is more prevailant (due to the web and mobile devices) but that is only a small piece of the developer pie out there. You forget all the people writing industrial, financial, research, etc. software that makes the world tick. Do you think that government contract that’s sent overnight mail on an airplane ever touches a line of javascript code?
        As for becoming a performance freak as you call it…I doubt it. Yes, some people head down that road as performance is a big requirement of whatever they are developing and there will always be programmers that focus too much on one aspect or another of the software they are developing but generalizing that if you write C or C++ code you’re likely to become a performance freak is absurd.
        In any case, yes JavaScript has it’s place in the world but as a recommendation for the first language someone should learn it’s a poor choice.

  • Pingback: Dew Drop – December 3, 2013 (#1675) | Morning Dew()

  • Dre Peters

    Well, I think, for me, the choice boils down to the person learning Python. It’s got all the batteries included.

  • DaveSchwReno

    Question for you: Imagine that you want to build commercial desktop applications for sale to the general public. What programming language would you suggest?
    (Please consider that the code must be protected, which rules out many languages.)

    • jsonmez

      I would most likely use C# in that case. C# can be reasonably protected and the desktop market is still primarily dominated by Windows.

      • DaveSchwReno

        Thank you for your response. What would you use for a distributable data engine?

        • jsonmez

          I’m not sure I’d have a general recommendation on that. It would depend on what exactly you were building and how it was going to be used.

  • Alessandro Martin

    CS101 courses are taught with an extremely wide variety of programming languages ranging from the lowest level (Assembly, C) to the highest level (Python which is almost executable pseudo code) and anything in between; the lack of consensus on the matter leads me to think that the language itself is not so important and a beginner shouldn’t worry about his/her first language being too low level or too high level, the main factor is to acquire general CS concepts (data structures, algorithms, design patterns, etc) and be as polyglot as possible. A well rounded developer should know about (among other topics) pointers, recursion and functional programming no matter if they are learned as a beginner or at a later stage, the “when” is far less important than the concepts themselves. I only wish to add that I felt very identified with this post since I recently needed to learn Lua for game scripting and I was able to learn most of the language in less than a week, so while the statement might sound a bit unbelievable to a beginner it really is true; languages aren’t tough, frameworks are the ones that require study, that’s why documentation and IDEs are so important.