This post summarizes and describes very briefly the most popular programming languages, and also reviews the characteristics that make a programming language different to other.
Characteristics of programming languages
When comparing different programming language, there are certain characteristics that must be understood and then compared.
In the same way there is not a single vehicle that is optimal to perform every possible task (a tractor is not the best for racing, and a sports car is not the best for plowing), each programming language has different characteristics and therefore has different advantages or disadvantages. There is not a “best” programming language.
Characteristics of programming languages:
- Purpose: general, specific
- Paradigm: imperative, object-oriented
- Abstraction level: low-level, high-level
- Machine code vs interpreted code
A low-level language remains very close to the computer architecture, and it implies that programmer needs to manage both the program logic and the computer resources. It means that they are closer to machine instructions and therefore have faster processing than high-level languages.
A high-level language adds abstraction layers and provide automatic utilities that allow programmer to focus on program logic rather than computer resources. These languages provide slower processing because the aid features are an additional burden on processor and automatized resource management may not be as optimized as if meticulously done by a programmer. On the other hand, they are usually easier to learn and work with them.
A strongly-typed or typed language means that any variable has a type, for example, number, character, string, etc.
A dinamically-typed or untyped language means the variables do not have any type declaration, or if they do, they can be transformed into another type transparently for the programmer.
Executable code vs interpreted code
An executable-code language are those whose source code (readable for humans) is translated into machine code (hardly readable for humans) in a step called “compilation” that is perform before the execution. A compiler is a tool that compiles source codes, i.e. it translate source code into machine code.
As the same machine code is not compatible among different platforms, these programs must be compiled for each different platform where it is going to be deployed. It also means that an executable file that has been compiled for a platform will not work (at least natively) on a different platform.
An interpreted-code language means that the executable file is not written in machine-code language and cannot be directly executed by the platform. Instead, it needs an application called interpreter that translated the interpreted code into machine code during runtime.
Interpreted-code are usually slower than machine-code language because it has the translation burden during runtime. On the other hand it may add some features, like joining compilation and execution on the same step or adding multi-platform compatibility of the same executable file.
Precompilation is the process of compiling a code (or translating a code into machine code) in a separated and previous step than execution.
All executable-code languages have mandatory precompilation, because compilation is mandatory in order to create a directly executable file from a source code.
An example of executable-code language with mandatory precompilation is C.
On the other hand, precompilation process could be mandatory or optional on an interpreted-code language.
An example of interpreted-code language with mandatory precompilation is Java. During compilation, source code is translated into interpreted-code, and then an interpreter called JVM (Java Virtual Machine) translates interpreted-code into machine-code during runtime.
An example of interpreted-code language without mandatory precompilation is Perl, where source code is both compiled (or translated to machine-code) and executed on runtime.
You can find a post of functional programming languages on this post.
List of popular general-purpose programming languages
All programming languages on this list are general-purpose and imperative.
List of popular programming languages:
Some popular programming languages have become less used, and has been replaced by other with similar characteristics and better features. They are included later on this post in the section “List of declining popular programming languages”.
Its first version was released on 1972, being the oldest of this list.
It is a low-level and compiled language. Because of all this, it runs faster that any other language. This is why, despite its drawbacks, it is still used in programs where processing speed is a critical factor (e.g., operating systems or device drivers).
For example, Linux kernel is written in C.
There are free open source utilities (compilers, debuggers, etc.). There are C compilers nearly all platforms.
There are different C versions, but the standard one is ANSI C.
C does not support object-oriented paradigm. The object-oriented programming language that is closest to C would be C++.
Application software done with C is declined in the last decades, and high-level languages are used instead.
C++ was designed as an extension of C. It supports object orientation natively.
Its first version was released on 1985.
It is still a compiled and low-level language. As it allows to manage computer resources while being object-oriented (easing larger projects), it is suitable for resource-constrained applications like video games or performance-critical applications.
Nevertheless, high-level languages are usually preferred for general application software.
To know more about C++, you can read this post.
Rust is a multi-paradigm, general-purpose and strong typed programming language. It was released on 2015.
It lacks a garbage collector and it is compiled, so performance is one of its strong points.
It has a dual license MIT and Apache 2.0.
Some professionals propose that it should substitute older languages like C or C++, like Microsoft Azure CTO Mark Russinovich.
You can read more about Rust on this post.
Java is a high-level, object-oriented, strong typed, bytecode-compiled and interpreted programming language.
It mains feature is that the compiled program can be run on any platform that has installed an specific virtual machine called JVM (Java Virtual Machine). The source code is compiled into what Java calls bytecode. The bytecode can be exported to any platform, and then interpreted by the JVM, thus allowing to run a compiled bytecode on any platform. This is why Java is called a multi-platform language with the motto “compile one, run everywhere”.
Its first version was released on 1995 by Sun Microsystems, that was later acquired by Oracle.
After the acquisition of Java by Oracle, using Java SE (Second Edition) platform for commercial purposes implies costs. Nevertheless, OpenJDK is an free and open source implementation of Java SE.
You can find an introduction to Java in this blog on this post.
C# is a high-level, interpreted and strong typed programming language.
It first version was released on 2000 by Microsoft.
To run a C# program on a device it is required to install an implementation of the .NET software framework.
Nowadays, there are 3 .NET implementations owned by Microsoft:
- .NET Framework. It was the first proprietary implementation by Microsoft.
- .NET, previously known as .NET Core. It is the official open-source implementation by Microsoft.
- Mono. It was an unofficial open-source implementation before Microsoft acquired it in 2016. After that, instead of being merge with .NET Core it was kept as a standalone implementation.
C# source code is pre-compiled into MSIL (Microsoft Intermediate Language), and then translated to machine-code by any of the NET implementations.
Python is an high-level, object-oriented, dynamically typed and interpreted programming language.
Its first version was released on 1991. It is owned by the Python Software Foundation (PSF). It has a BSD-based license.
You need to have a Python virtual machine installed in your computer in order to run a Python application. The Python interpreter is called CPython.
One main characteristic that makes Python is that it is dynamically typed. Because you do not need to worry about the variable types, it is easier and it is common among beginners and casual programs.
Python is sometimes referred as a glue language, because it is often used to connect large software components.
However, Python is not that mature compared to some other programming languages. On the other hands, there are multiple libraries available for Python.
You can find an introduction to Python in this blog on this post.
Go, or Golang, is a programming language developed by American company Google.
It focus on simplicity and concurrent systems.
Despite its name and some similarities on its syntax, it has little to do with Java.
TypeScript is released with an license Apache 2.0, making it FOSS. It was first released in 2012.
Kotlin can create applications for Android, iOS, macOS, Windows and Linux, among others.
It is an bytecode-compiled language that produces Java bytecode by default.
It is the preferred programming language for Android, substituting Java.
It is developed by JetBrains.
Swift is the default programming language for Apple OSs.
What programming language should I use?
If you are a beginner and want to start with an easier programming language or are doing a general simple application, use Python.
If you need to control computer resources, are looking for resource-constraint applications, or performance is a key factor then go for C, C++ or Rust.
If you want to build robust desktop or server applications, use Java, C#, Ruby or Python.
If you are a computer science student that wants to learn about how a computer works and the most popular low-level language, use C.
If you want to focus development on Android, learn Kotlin. If you want to focus development on macOS or iOS, learn Swift. If you want to develop for multiple operating systems, look for cross-platform frameworks and then choose the programming language related to the selected framework.
List of declining popular general-purpose programming languages
The programming languages featured here are not dead. They are still maintained, and there are still many legacy projects that use these languages. Nevertheless, if those projects were to be started today, they will not probably choose these languages. A recommended replacement for each language is described on each section.
Fortran is a general-purpose programming language aimed on scientific and engineering computation.
Its first version was released 1957, and it is probably the oldest programming language that is still used today. It started to be programmed on punched cards.
Nvertheless, take note that Fortran is still used on supercomputer programming.
Its replacement would be C.
ALGOL was a programming language, first released in 1958.
It would have been replaced by C.
COBOL (an acronym from Common Object Business-Oriented Language) is a programming language that was very popular in business, finance and administrative systems for companies and governments. It first version was released in 1959.
Its replacement would be any that other programming language is business supported, for example, Java or C#.
Pascal was an educational programming language, first released in 1970.
It could be replaced by C, considering low-level languages, and Python, considering high-level languages for educational purposes.
Objective-C was first released in 1984. It was first used on NeXTSTEP OS.
It was the main programming language for Apple OSs, like macOS or iOS, until the arrival of Swift. This is why a natural replacement for Objective-C is Swift.
Perl was first released in 1987.
Its natural replacement would be Python. Check this external post supporting this idea.
Ruby is high-level and dynamically typed programming language.
Its first version was released in 1995. It has a BSD-based license, making it FOSS.
It is mostly used for the Ruby on Rails (RoR) framework, dedicated to web back-end development, so its community is focused on web and server-side programming.
The alternative web back-end development frameworks that use more versatile programming language are:
- Django, written in Python.