Friday 13 June 2014

Which programming language to learn first

So you want to learn programming. Which programming language do you start with? There are so many programming languages out there. Wikipedia lists about 650 of them here. From the well known ones such as Java, Python, C#,  and Javascript to less popular ones such as E, A+, and Onyx. With all these choices, it's hard to figure out where to start out.

Depending on who you ask, different people are going to give you different advice. Some will suggest that you should just go with the languages that are popular and most used. According to tiobe, the most popular programming languages as of June 2014 are C, Java, Objective-C, C++ and C#.

 
tiobe index for June 2014

Others may suggest that you learn an object-oriented programming language. These are languages which use a programming paradigm that represents the concept of "objects" that have data fields (attributes that describe the object) and associated procedures known as methods. Objects, which are usually instances of classes, are used to interact with one another to design applications. Examples include Java, C#, and Python. Some of the advantages given to OOP languages include:
  • Increased understanding.
  • Ease of maintenance.
  • Ease of evolution.
Other people may suggest you begin with functional programming languages. These are languages which treat computation as evaluation of mathematical functions and they avoid state and mutable data. Examples of FP languages include Haskell, Clean, and Idris. These are pure functional languages meaning that entities in the programming environment are never updated. The identifiers therefore refer to immutable and persistent values. Haskell seems to be the most popular in this category. There are impure functional languages too such as Java (since version 8), Scala, Python, Mathematica, Rust, and OCaml. An impure FP language is one which has all the features of a pure FP language however it also allows things like side effects, object construction and mutability in a controlled way. Some of the advantages of FP languages include:
  •  Encouraging safe ways of programming.
  •  Stateless programming.
  •  Encouraging quick prototyping.
  •  Programs are usually shorter. 
That being said, functional programming isn't used much for commercial applications. Reasons for this can be read in this stackoverflow thread http://stackoverflow.com/questions/2835801/why-hasnt-functional-programming-taken-over-yet?rq=1 

So back to our question. Which language should one learn first. I think the best language to learn is one which is able to do the task that one wants to do. For example, if you want to start by making websites, then choose a language that is used to make websites. If you want to make mobile apps, then choose one that can do so. If you want to do scientific computation, then same thing. Below I have outlined the most used languages that are for particular tasks.

  1. Android Development - Java
  2. Windows Phone Development - .NET
  3. iOS Development - Objective-C and Swift
  4. Front end Web Development - HTML, CSS and Javascript
  5. Back end Web Development - Python, Ruby, PHP, .NET, Go and Java
  6. Embedded Programming - C and C++
  7. Scientific Computing - Python, C and Fortran
  8. High end Game Development - C++
  9. Web Game Development - Flash, Javascript, HTML5
Of course, there are many other languages for different use cases. However, for the first language to learn, I think these are good to go. Happy coding!