Welcome back, Fortran!

TIOBE — the software quality company — has just released its latest (April, 2021) statistics on the popularity of programming languages, the so-called TIOBE Index. They collect the data from several sources in parallel and update the list monthly. According to them, this list is intended to help developers and system engineers to decide which programming language to apply in a certain area, which can be considered a reasonable choice on a given field, which one to keep oneself updated with, or learn next, and which one to base your new project on.

Probably the most valuable outcome of populating such list is the insights we gain on how popularity may change over time. Graphs like the one below may cause some programmers to panic, or lay back and relax enjoying the fulfillment that choosing the relevant programming language to master may grant them.

This month’s little surprise was the comeback of a Methuselah of a programming language, Fortran. This venerable language derives its name from ‘formula translation’, and mostly used for scientific calculation, modelling, and parallel computing. With its first release date of 1957, is one of the longest living and continuously used programming languages out there.

Fortran is not only failed to decline over time, but is gaining popularity recently. Has everybody just gone retro in their programming language preference? What the heck can we use a programming language of your grandpa for? It turns out that quite a lot. When you checked your local weather forecast today, chances are that it was generated based on the data calculated by one of the supercomputers running some Fortran simulations. Fortran feels itself in halls filled with high performance computer clusters so well, that it’s also used to benchmark the performance of such giants. Among Fortran’s merits are the capability of modelling fluid dynamics, and therefore simulate and predict tsunami events, which you also can pretty much master from a recent book released on Fortran by Manning.

Its scientific applications would be enough to lift Fortran into the hall of fame of programming languages, but it doesn’t stop there. In fact, Fortran has a so clear syntax that it influenced masses of programming languages in the past, present, and most probably the future as well. Fortran influenced Algol, Algol influenced Ada, C, Delphi, Elixir, Java, Python, Ruby just to name a few. I started programming in Basic on a Commodore 64. Basic is more like a direct descendant of Fortran when it comes to syntax. Several of the aforementioned languages gained their reputation having a human readable, programmer friendly syntax, which goes back to Fortran.

Let’s see that in action:

This is my version of ‘Hello, world’ in Fortran, where I tried to show some of Fortran’s basic features. The program defines an array of two different greetings (line 5), then generates a random number between 1 and 2 (line 7) using the function defined in line 21. Fortran arrays are indexed with 1 as initial value. If we’ve chosen ‘Hello’ randomly, then we write ‘Hello, Fortran’ 10 times, while if we’ve chosen ‘Servus’, then we greet just 5 times. Line 9 shows the equality condition phrased the Fortran way: i.eq.1. Finally, we just iterate, and print the random generated greeting the determined times (line 15).

It’s definitely not the brightest Fortran program ever written, but it does the job of providing a sneak peak into the language better than the average ‘Hello, world’ program.

So Fortran, good to see you around, and welcome back to the Top 20, where you have a good company.

A seasoned web developer nomad