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.
List of popular general-purpose programming languages
All programming languages on this list are general-purpose.
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.
Java is a high-level, object-oriented 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.
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.
There is a post on this blog about Python on this link.
Ruby is high-level and dynamically typed programming language.
Its first version was released on 1995. It has a BSD-based license.
Its community is focused on web and server-side programming.
Despite its name and some similarities on its syntax, it has little to do with Java.
What programming language should I use?
If you are doing a general simple application, use Python.
If you want to build robust desktop or server applications, use Java, C#, Ruby or Python.
If you need to control computer resources or are looking for resource-constraint applications, then go for C or C++.
If you are a beginner and want to start with an easier programming language, use 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.
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.
COBOL is a programming language that was very popular in business, finance and administrative systems for companies and governments.
Its replacement would be any that other programming language is business supported, for example, Java or C#.
Perl’s replacement would be Python. Check this external post supporting this idea.