Paul Kilfoil's World of Travel, Technology & Sport



Posted on  by Paul Kilfoil.
Like this story...?

 
 
 

 

I am a software developer and regularly use tools like Microsoft Visual Studio and Microsoft SQL Server in my daily work. These are modern products, with Integrated Development Environments geared towards cutting-edge web and mobile application development. In many ways tools like these make development easier, with features like Intellisense, auto-correction of errors, drop down lists of possible method calls, instant help, function parameter lists and so on. But actually, all these sophisticated features merely make development manageable, because the environment we work in today is orders of magnitude more complex than it was twenty years ago.

Fortran ... on Microsoft Windows in 2013

I was reminded of this the other day. A client phoned me and asked me to do some work on a suite of programs he had that were written in Fortran. Yes, you read right, Fortran - the very first "high level programming language" ever devised and which is still alive and well and kicking in the 21'st century. Fortran was originally thought up at IBM by a programmer frustrated by the relentlessly unforgiving nature of machine-code and assembler ; that was back in 1953. The first Fortran compiler for IBM mainframe computers appeared in 1957 and before long most other manufacturers had also produced Fortran compilers for their machines. Thus the first English-like programming language was born and became widely used.

In the 1970's and 1980's most first-year university students in Science and Engineering faculties round the world learnt Fortran (I did). In fact, while I was a B.Sc (Honours) student I even wrote an entire online data capture system in Fortran for the Mathematical Statistics department at the university I was studying at! That seems incredible now, but they used my system for several years quite happily.

Visual Studio and SQL Server ...
beyond the wildest dreams of the hard-core programmers of the 1950's

So how is it that Fortran has survived for over FIFTY YEARS? Because, for scientific and engineering applications where lots of mathematical calculations must be done on large volumes of raw data and all that matters is the right answer, Fortran is absolutely without peer. Physicists, astronomers and engineers don't care a jot about fancy graphics, pictures and all the other bells and whistles that the spoilt "now generation" has come to expect - they just want their data analysed and to get the answers as fast as possible. This is what Fortran was devised for (the name "Fortran" comes from "FORmula TRANslator") and even today it does the job brilliantly. Try using Microsoft Visual Studio to compute potential orbits of comets round the sun, taking into account gravitational interactions along the way with planets like Jupiter and Saturn ...

I was forced to brush up on my Fortran knowledge to help the chap who phoned me (I last used the language back in 1982), but it didn't take long because I discovered that the basic syntax and semantics has hardly changed in the last thirty years. I installed a trial copy of Simply Fortran from Approximatrix and had the system up and running pretty quickly. It was an interesting and unusual experience, and I'm glad I was able to help.

What's next? PL/1? Pascal? No problem, but I draw the line at ISAM data processing in COBOL ...

C Fragment of a Fortran program
C -----------------------------
      INTEGER K
      K = 0
C Start with zero, now loop ...
  100 K = K + 1
      IF ( K .GT. 40 ) GO TO 200
      :
      :
      GO TO 100
C This is where we exit the loop
  200 PRINT 'DONE'
      STOP
      END

[Aside : If you don't know Fortran, it was a language designed to be captured on the 80-column punch cards used in the 1950's and 1960's. Comment lines were flagged with a "C" in column 1, statement numbers (which were optional and principally used in "go to" logic) went in columns 1-5, column 6 was reserved for a "continuation" symbol (when a statement was so long that it spread over several lines) and the actual program code went in columns 7-72. Columns 73-80 were ignored by the compiler, the idea being that these would be used by the programmer to capture a sequence number in case he dropped his deck of punch cards on the floor and had to sort them into the right order again manually ; I don't know of any Fortran programmer who ever used this feature (or regretted not using it - the "cards on the floor" syndrome was easily avoided by putting an elastic band round the pack of cards).

In the box on the right there is a sample fragment of some very primitive Fortran code. Note that this example does not in any way mean that I endorse the use of "go to" statements - they are there merely to illustrate the kind of structure that was the norm back in the 1960's]


  © Paul Kilfoil, P O Box 1091, Sun Valley, 7985, South Africa