People often ask “what is the best programming language” to the reply “depends on what you’re doing” – an answer which is paradoxically as true as it is unhelpful. This article is intended as the first of three for a comparison of all the major, common, and modern programming languages. It’s not meant to be exhaustive or extremely technical – it’s meant to be helpful! It’s meant to give you enough of a background to know the mindset and major goals of each of these languages. The languages included are based on the Stack Overflow 2017 Developer Survey.
A breakdown language-by-language will be available in part two – soon!
C-Family of Languages
In the 1980s the C language was probably the biggest advancement in programming. It’s still the benchmark by which all other languages are measured, especially when it comes to speed. This is because you can write low-level C in a way that you know almost exactly what computer instructions it will execute. C is effectively a reasonable alternative to writing machine code. In fact, many languages compile into some form of C code instead of going directly to assembly/binary (the language of your computer processor). On top of that, C compilers make dozens of optimizations to further improve speed. But with great power comes great responsibility. In C (and C++/Objective-C) the programmer must manually manage memory (e.g. delete variables), and this is the source of many bugs. Languages like Java and more recently Rust were fueled by an effort to avoid these common, pesky memory bugs.
Unlike the previous two categories, this family of language isn’t related by syntax. Syntactically, Java very closely resembles C/C++. Java is one of the most sought after languages because it was popular in large enterprise software systems. Unlike C/C++, you don’t have to deal with memory management, it runs on any operating system and a crashing Java program won’t bring down your whole computer or server. That’s because it runs in a Java Virtual Machine (JVM) which provides some security guarantees while remaining relatively fast. It also means any Java program can run on any OS with the same code.
The languages in this category run on the JVM as well and most are typically seen as improvements over Java -- with Kotlin and Groovy staying closer to Java’s imperative roots, and languages like Scala and Clojure taking a different, more functional, math-based approach borrowing from languages more commonly used in academia. All these languages can still interface with older Java programs and therefore have tons of libraries, as well as compatibility with legacy Java code.
- S (predecessor to R)
LISP, like functional programming, evolved from a theoretical alternative to Turing Machine. It was invented by John McCarthy in 1958. It was just a simple theoretical language at first, loved by academia, but it was way ahead of its time. It introduced many high-level concepts that we use today.
Its power comes from how it elegantly supports meta-programming (programs that modify themselves). It can do a lot in just a short amount of code. This makes it both extremely powerful but sometimes harder to reason about (bad LISP code can be very confusing to read and understand). It’s truly a shame it does not get used more, people are often simply adverse to its syntax. Clojure is the most popular variant used in production systems today.