Your Next Programming Language (Part 1 of 2): The Broad Categories

Ryan Taylor

blog header image

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

  • C++
  • C#
  • Objective-C
  • Go
  • Java
  • Python

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.

Pascal-like Languages

  • ALGOL
  • Pascal
  • Modula
  • Delphi
  • Go
  • Python
  • Nim
  • Lua
  • JavaScript
  • Ruby
  • Swift

Pascal was popular in education because it’s simple and easy. It’s imperative and procedural like C, but without confusing memory management and usually without compiling. Pascal’s simplicity influenced many other languages, notably JavaScript and Python -- two of the most popular languages today. This family contains some of the easiest languages to dive right into, and once you’ve learned one you may find it not difficult than the C-like languages. However this simplicity comes at a price, and they are often a bit slower than C.

JVM Languages

  • Java
  • Scala
  • Kotlin
  • Groovy
  • Clojure

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.

LISPs

  • CLISP
  • Clojure
  • S (predecessor to R)
  • Scheme
  • Racket

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.

Functional Languages

  • F#
  • Haskell
  • OCaml
  • Elm
  • Erlang
  • Elixir
  • Rust
  • Scala

Like LISP, functional programming languages have a separate set of theoretical roots. Way before computers, when Turing invented the idea of procedural code (step-by-step instructions like C and Pascal), Alonzo Church invented lambda calculus -- something more akin to algebra (and no, not calculus). It was later shown that these two approaches were two different ways of writing the same thing, and equally powerful. Functional programming is a blessing when it comes to data manipulation and the ability to reason about code, particularly code correctness. Most purely functional languages use something called static typing that prevents the programmer from making certain types of runtime errors. However for a long time, these functional languages haven’t been as good at things like complex error handling, and highly speed-critical and memory-critical tasks making them less popular than C. That said, most of the innovations in newer languages come directly from functional programming. You add functional programming and static typing to C/C++ and you get Rust, add it to Java and you get Scala, add it to JavaScript and you get Elm, it’s also the backbone of distributed languages like Elixir/Erlang.

headshot

Ryan Taylor

Developer

Technology