Classifying programming languages

How do you compare programming languages? You might dive right in and examine differences in syntax or idioms. You could compare target platforms or contrast their Hello World implementations. All of these can help paint a picture of how two programming languages might differ.

But these approaches are quite specific, and don't work as well for describing groups of related languages. That is where the concept of programming paradigms becomes quite useful. Programming paradigms provide a means of classifying programming languages by common features or patterns. They provide a broad, high-level classification mechanism with which we can quickly group and compare different programming languages. 

Using programming paradigms to classify languages dates back over 40 years. Robert W Floyd is thought to have been the first to use the notion of a programming paradigm in his Turing Award lecture detailing the work of Thomas Kuhn.

While these classifications may not give specific details about language syntax or where the code might run, they allow us immediately to understand key aspects of a language such as how data is modeled or how computation is done.

There are many examples of programming paradigms:

All of these represent some set of characteristics than can help you understand how a programming language can be used. In many ways, these high-level characteristics are more useful for language comparison than specific details because they cut straight to the root patterns and conventions present within a language while skipping over their specific syntax and idiosyncrasies. 

As many software developers can attest, syntax is often easy to learn from one language to the next. When learning new languages, the more difficult challenge, often, is understanding and adopting new mental models of how to model and structure a program. Robert W Floyd described this challenge well:

"To the designer of programming languages, I say: unless you can support the paradigms I use when I program, or at least support my extending your language into one that does support my programming methods, I don't need your shiny new languages."
– Robert W Floyd, The Paradigms of Programming, 1978

These challenges can be mitigated by understanding the programming paradigms embodied by a new language, and then drawing on experience from other similar languages.

In the rest of this section, we'll build up our understanding of common classifications of programming languages to understand better how Kotlin's supported paradigms relate to one another. We'll start with a quick explanation of multi-paradigm languages.