Best programming language?

Depends on what you want to optimize.

If you know what you’re doing, want the fastest code possible, and do not care about optimizing development time, then assembly is the best.  If you want function abstraction and named variables with your assembly, use C and accept a small runtime vs. development time tradeoff.  If you want object abstraction, use C++ and accept a larger runtime vs. development time tradeoff.  If you want automatic garbage collection, use a garbage-collected language (Java, C#) and accept a larger runtime vs. development time tradeoff.  For the same applications you’ll want more memory as well.  (I’ve been told you can run Java programs at the same speed as the equivalent C++ programs if you have 80% more memory.)

If you want a language with an easy learning curve and great libraries, use Python an accept a huge runtime vs. development time tradeoff.  If you are doing web programming, you should probably use something like Python for your backend language.  (It’s also possible to use Java, Ruby, or even Go.)

If you are looking for specialized routines, then MATLAB/Fortran (scientific computing) or R/Stata (statistical analysis) may be most powerful for you.

There are functional languages (categorized as such because they have higher-order functions, partial application, and all that jazz) all along this spectrum.  Conventional wisdom says that with functional languages you accept a runtime vs. development time tradeoff, but the more familiar you are with the language, the less the tradeoff is.

If you are choosing the most powerful language to learn, I would recommend learning a statically typed functional language like OCaml or Haskell.  While learning something like Python will have the highest immediate payoff because of the shallow learning curve and its abundant library support, learning a functional language will teach you to think about programming in ways that make you more effective in all languages.  For instance, working with algebraic data types and pattern matching in a strongly typed language teaches you to reason explicitly about what your data should look like and helps you organize your code in languages as low-level as C.  Having constructs such as higher-order functions, algebraic data types, polymorphic functions, and type classes (for organizing overloading polymorphism) in your mental toolbox can make you a much more powerful programmer.  A downside of many of these languages is that there is only a small community that uses them–hence lack of tool and Q&A support.

Scala lives in a nice sweet spot of providing functional features while having a healthy and growing community using it for development code.

Leave a comment

Your email address will not be published. Required fields are marked *