Choosing a Programming Language

Programming-Languages.jpg

Sometimes I wish I could talk to my past self and pass on a piece of information. I wish I could talk to “Poof” 10 years ago and describe the differences between various programming languages.

Here, in a note to my past self I attempt to correct this failing. While discussing programming languages can be controversial, since I am talking to myself the reception should be okay.

Please leave any comments on my unfair treatment of, fan-boy attitude toward, or general incorrectness about any particular language. The languages are pulled from the Tiobe 20 with some modifications and additions. [1]

C

– The workhorse of systems programming. Wanna write drivers for the Linux Kernel or graphics for video games (not the Photoshop variety but the physics variety, handling game engine performance). Pointers in all their glory and the power of memory management. Probably a pass unless you know this is what you want to do and why. It can power a lot, but it is the low level procedural language in all its glory (not counting Assembly).

Java

– Possibly the blub programming language? Ubiquitous in enterprise (aka. large corporations) and Universities. Almost as fast as C and similar in syntax, but with safety features on things that allow programmers to shoot themselves (such as pointers and memory management). Easy to fall into since it touches so many different things. Hitleresque regarding the Object Oriented paradigm. There are cool aspects (perhaps Spring and Hadoop?), but run, don’t go down this road. [1]

Scala

– Java’s cool cousin. All the good stuff of Java (the immense infrastructure and resources), but with a cool functional twist (like smoking cigs in the parking lot with the cool kids). If you are going to learn Java, learn it via Scala. Pay attention to words like Map and Reduce. Study up on recursion and pattern matching. Think in a functional mindset, don’t forget your math: f(x) = x. Good teams use it: Twitter, Firebase, Coursera, etc. Good for infrastructure. [1, 2]

Objective-C / Swift

– IOS or Mac programming. Probably pair with Android and go for mobile, although hope for the success of HTML5 and a merging of phone differences in similar fashion to browser differences. It is better for all developers to be able to create an interface in one language that works on all devices. Only choose Objective-C if you need the special features and functionality on iPhones or iPads for something like augmented reality or games. [1]

C++

- The object oriented version of C, thus C plus 1. Again, you probably shouldn’t bother with it unless you absolutely need the performance and can’t scale with more machines. Pointers and C/C++ are more a right of passage than a viable means of rapid development, although it does power Google and many other things. [1, 2]

PHP

– The easiest way to do web programming. A procedural monstrosity with new object oriented makeup (shining a turd?). Ubiquitous for web development and nothing else. Go with it to quickly build a website, but recognize that its potential is limited. Tons of tools and developers, but its embedded nature makes it tough to scale. You will be better of in the future with Ruby, Python, JavaScript, Scala, etc. [1]

C#

- The new Microsoft way of doing things. Java meets C++. If you love Microsoft, want to work in enterprise development and don’t like Java then go with C#. Otherwise, avoid it like a deck chair on the Titanic. F# could be interesting. Amazing things can and have been built with it, but the choice was most likely due to team familiarity with the Microsoft ecosystem. [1]

(Visual) Basic

– The old Microsoft way of doing things. Don’t touch this unless you are working on a secret government computer in Iraq and are killing time building a Sudoku solving program in Excel. [1]

Python

– Learn this language. As close to pseudo code as a language can be. Great for systems programming, web development (Django, Twisted, Tornado, Flask, etc.), or scientific research. Plays well with C for performance. Consuming everything in its path: lisp at MIT, R for data analysis, C for computer vision, Matlab. [1, 2, 3]

Perl

– The daddy of scripting languages. So fantastic at string parsing and regular expressions that other languages have stolen its mojo and absorbed the best parts. Pass unless dealing with legacy code. [1]

JavaScript

– Learn this language. The only option in the browser. Bad parts and good parts. Study up on prototypical inheritance and closures. Moving from the client to the server with Node. Some believe it will reign preeminent and eat up the world, but I think Python will triumph on the back-end due to its strength in Academia (ironic when compared to Lisp).[* see footnote] Don’t forget to pickup HTML and CSS too. [1]

Ruby

– Possibly learn this language. When paired with Rails, may be the best option for rapid web development. A syntactically-elegant, dynamic cousin to Python. Translate your knowledge into client side development with CoffeeScript. May get caught in a pincer movement between JavaScript on the Front-End and Python on the Back-End. Watch out for the community. [1]

SQL

– Not a programming language, but variants are. The main way to communicate with relational databases. Don’t learn this unless you need it. Many frameworks will have wrappers. While RDBs aren’t going anywhere, NoSQL may be the better option for a majority of your tasks.

Lisp

– The mainstay of Academia and Artificial Intelligence. Variants abound: Scheme, Closure, etc. Must have a love of parenthesis. A great language to learn about programming from a mathematical perspective. While it has been used in production, its primarily role has been inside the glass house. Pass, unless for pure learning. [1]

Matlab

– Another workhorse of Academia. Capabilities in computer vision, statistical analysis, and much more, not a general purpose programming language. For similar tasks you can use the free version: Octave, but you should really just focus on Python and IPython.

Bash

- Shell scripting. Crucial to learn the Unix tools such as grep, sort, cat, pipe, etc. Can, however, perform the exact same tasks in other more powerful general purpose scripting languages such as Python, Perl, and Ruby. [1]

Pascal

– Avoid like the plague along with Fortran and Cobol, unless an absolute necessity for work.

Assembly

- Only learn if your code needs the absolute in performance and you can’t scale it with more machines. Or if you are into NOP sleds. Can be beneficial, like Lisp and C, for gaining a better understanding of computers, but best avoided unless you want to stab things into your eyes.

Erlang

– A functional language for your tool chest. Haskell and its type system may be better learning. For concurrent server code, Go may be a better way to go. When solid in another language or two, study these for a better grasp of functional programming, type systems, and concurrency. [1]

Prolog

– Logic Programming. An entirely different way of programming from from functional, object-oriented, or procedural programming. Maybe worth studying, but practical applications are so far limited. Who knows, maybe it’s the future and will infiltrate the mainstream just like functional programming did due to its ease of use in parallel architectures.

In conclusion: Learn Python and JavaScript for the long haul in multiple areas: client, server, sys admin, data analysis, computer vision, machine learning… Learn Ruby and Rails for a short sprint in web development. Learn Scala if working with a team on infrastructure. Learn Scala and Objective-C for mobile. Learn C, Lisp, Haskell, Go, Prolog, SQL, or Octave if the time, inclination, or need presents itself.

* The first draft of this was written a few years ago. I’ve since come to believe JavaScript is the only must learn language.