Worst language I wrote in – Fortran

One of the worst programming languages I ever wrote in is Fortran. It’s got a rather limited set of features. I dreaded to go work every day staring at the lines of codes that basically represent a cholesterol research paper’s equations.

I was using the g77 compiler. The only thing that I can remember is all the nonsensical representation of while loops. It has got the most basic support for structural programming. I had the impression that programmers in the 1970s are like artists, they paint a first layer and paint a second then the third and if there’s a mistake they cover it up with a thick coat of paint. The whole software is like a gibberish piece of code and no amount of comment ever made my life easier the next day.

However it is through Fortran that I start appreciating the more modern programming languages. I look at for each loops imagining how confusing would it be to represent the same code in Fortran.

Every time I hear people whine about how many lines of codes and how confusing a code chunk looked, I wish those people could see things from my point of view. Imagine the number of mistakes made and later corrected for the supposed better.

1 thought on “Worst language I wrote in – Fortran”

  1. If you were using g77, you were writing Fortran 77, a standardization of older Fortran variants that came out about the same time as K&R C and more than 10 years before ANSI C would be standardised. What other programming language still has legacy code sufficiently usable and from 40 years ago? 😛 (possibly COBOL, ADA and maybe a few others but that’s not the point)

    It is a whole different kettle of fish to Fortran 90/95/2003, the latest of which has everything you would expect in a modern programming language (which in many ways F77 wasn’t), and more than a little support for object oriented code, but is still carefully designed to let compilers optimise the crap out of it (no unrestricted pointers, a few careful restrictions on aliasing here and there). And the array syntax is probably without comparison in a similarly compiled language. OK there are a few oddities such as fixed length strings and format descriptors, but that’s no worse than C…

    It’s not necessarily a programmer’s language, it’s a scientist’s language; with the advantage that it is far easier to do complex numerical work with multiple levels of parallelism etc. efficiently in Fortran than in C++ (assuming non-compiled languages are too slow). Virtually all Fortran compilers support OpenMP, and most (all?) MPI libraries have Fortran bindings. It is also (apparently) far easier to teach in a limited time slot.

    For the code I work with, only the number-crunching part is important, and Fortran is perfect (although it might be nice when we get the next Intel compiler with all the fun if probably slow object oriented abstraction stuff…)

    Basically chances are most of the stuff you hated about it was probably fixed back in 1991, which the exception of the clever stuff you get in scripted languages.

Leave a Reply

Your email address will not be published. Required fields are marked *