Thursday, November 10, 2011

What programming language should I learn next/first?

I'm always looking for posts about what programming language I should learn next to help me become a better programmer.

My brother-in-law was asking me just this question, which led me to come up with the answer I hold currently. Please take my advice lightly since much of it is base on my own opinion and I've not yet had the opportunity to learn the languages I'm going to talk about, but this essay delves into the thinking a bit of why I choose to go the direction I am headed in for the moment.  It is yet another opinion you can think about as you might be asking yourself the same question.


To start things off here are a few good articles that I've come back to over the years, which are definitely worth reading if you are interesting in programming or thinking about learning a new language or taking your skills to the next level:

I recommend learning a dynamic language such as python, ruby, scala, haskell, or clojure (maybe even Perl, Jython or Groovy). There is something to be said about the type of communities that exist behind these languages. They are dev centric and not driven by the "market".

Scala, Clojure, Jython and Groovy run on top of the JVM, so they allow you to use all the java libraries you can find out there. There is even a version of Smalltalk that runs on the JVM, but it is relatively new.

Ask yourself which would you gain the most from learning the language you are interested in right now? What are your personal goals and motivations, what do you need to get back in order to stick with it?

Perl is getting long in the tooth, but still used everywhere. It is flexible, easy to learn the basics, although the syntax is horrid and you will run into some of its limitations rather quickly once you begin building more complex programs. It is a great glue language and good for quick and dirty scripting and automation.

I've heard Ruby has a gentle learning curve and succinct syntax.

Python is great and worth learning. Jython is python running on the JVM, so it is great for those who know python and want to leverage that knowledge on the JVM.

Scala is a next gen quasi functional language that fully embraces the OO paradigm and runs on the JVM. It is a great language to complement a Java coder who wants more flexibility and the ability to do rapid prototyping. Perhaps one day it will replace Java.

Clojure is similar to Scala in that it is functional, but not purely functional like Haskell, it is however a Lisp dialect. Clojure runs on the JVM and although you can program OO in it, that is not its greatest strength. Lisp was originally developed from the Lamda calculus and the best fit for dealing with functions. Clojure is great for hard problems and concurrent programming, things are mostly immutable and you don't have to worry about complicated locking schemes.

The languages that run on the JVM can interop with other Java code and leverage the many Java libraries in existence allowing great flexibility. This also makes it easier to introduce your code into a more conservative environment. I've known a few folks who convinced their bosses to let them write unit tests in these languages.

Personally I'm learning Clojure at the moment and I plan on learning Scala next after I become more adept with Clojure and probably Python as well someday. For fun I also want to learn Haskell..

Clojure and other languages can run on the .NET CLR. From the looks of where things are are going with newer languages many of them run against different virtual machines (like JVM and .NET CLR) and you wont necessarily be tied to a platform in the future.

Of course there will always be a need for machine specific compiled code for things that need all the horsepower like operating systems, compilers, device drivers, games, etc...

There are real strengths in knowing a handful of different programming languages, and learning what the languages strengths are and how to leverage that knowledge properly. You can cut wood with any saw, but some saws work better than others and different types of wood are good for certain things.

Python, Ruby, Scala, Clojure, and Haskell are what I consider the gems of the programming world. Start learning these and you will learn concepts that can transform your thinking and really take you places. Haskell is probably the least practical, but could possibly give you the most reward. I might add F#, but I don't know much about it, but it would probably be a good thing to check out if you work with Microsoft products.

Assembly, C and C++ are great if you are hardcore and want to work for Google, create operating systems, design fast compilers, hardware drivers, and develop games. They are good getting at the low-level stuff, but as hardware continues to get faster, we are reaching a point where in most cases you can use a higher level language with a lot of abstractions to still crank out a fast program.

I think after learning a couple of the "gems", you should have a pretty good idea if you are the type who might go the Java/C#/VB route or get into C/C++. Maybe you won't ever have to do either though or you might want to foray into both a bit, it all really comes down to what you are interested in and to follow that passion.

Once you start learning a few different programming languages it becomes less of a big deal to learn others, and you can begin to group languages into logical containers based on their conceptual similarities.

Javascript and PHP are good to learn if you are into web programming, but I would still recommend learning the gems beforehand. Javascript is known to be very hard to become proficient with because it is so flexible. There are now many cross-compilers that take Java, Python and even Clojure code and create javascript, since it is the dominant dynamic language used on the web.

So more food for thought as you ask yourself what programming language you want to learn next.

Here are some other bloggers sharing their wisdom along these same lines:


  1. It is very interesting after a while to find this article. I think programming languages over time will evolve because applications and demands will continue exisistiendo. Thank you.

  2. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Training in Chennai Core Java 8 Training in Chennai Core Java 8 Training in Chennai JavaEE Training in Chennai Java EE Training in Chennai

  3. Java Online Training Java Online Training Java Online Training Java Online Training Java Online Training Java Online Training

    Hibernate Online Training Hibernate Online Training Spring Online Training Spring Online Training Spring Batch Training Online Spring Batch Training Online