Too Much Confusion

fortran-wheelThere is a lot of confusion and misinformation about the Fortran programming language on the internet, and a general ignorance about it among programmers. Most younger programmers who use languages invented five minutes ago probably have never seen it, and may only be dimly aware of it as some obsolete language that nobody uses anymore.

You may be surprised to learn that Fortran is a modern, object-oriented, general-purpose programming language. Fortran is not a programming language created by computer scientists to write operating systems, nor does it include every single programming concept anyone’s ever heard of. It is a language designed for computational efficiency and efficient array manipulation, and has a clear uncluttered syntax that can be read and understood by non-experts with only a little effort and training. It is particularly suited for numerical and scientific programming by non-expert programmers such as engineers and scientists. Learning all of Fortran is considerably easier than learning all of C++ (as an example). Sure, you can’t do template metaprogramming, but few engineer/scientist types would ever want to do that anyway (besides, it’s bad for you and could make you go blind).

By “Fortran”, I mean modern Fortran (i.e., Fortran 2003 and 2008, which is the latest standard). Yes, the roots of Fortran go way back to the 1950s. Sure, early Fortran programs were written on punched cards. So what? Latin was once scratched into wax tablets, but that isn’t really relevant to modern Italian and French speakers. In fact, the Fortran language has evolved considerably since it was first standardized in 1966. It generally has followed a cycle where a major update is followed by a minor update (1977=minor, 1990=major, 1995=minor, 2003=major, 2008=minor). It has been said that the 2003 update was as big an update to Fortran 95 as C++ was to C! Ten years later, the GNU Fortran compiler is still not fully F2003 compliment (the Intel compiler only recently became so).

People who attempt to enter the world of Fortran programming are easily corrupted and discouraged by misinformation. Even a lot of old-school Fortran users are unaware of the later standards. This is too bad, because modern Fortran is actually quite a respectable programming language for a lot of technical applications.  This article is a pretty good overview of Fortran for C/C++ programmers. However, it is outdated, since it is confined to Fortran 95.  Most of the limitations it mentions (no procedure pointers, clunky character strings, lack of an intent attribute for pointer dummy arguments, the nonstandardness of the ; character) have been rectified in subsequent standards.

The fact is the internet is not really the best source of information for modern Fortran. One day, maybe, there will be vibrant community of Fortran users on the internet, extensive online documentation, open source projects, and all your questions will simply be a web search away (cf., Python). But for now, you’ll probably have to buy some books. If a book has the numbers 77, 90, or 95 in the title, don’t open it, it will only confuse you. This is not to say that there aren’t friendly Fortran folk on the internet who will also help you out. Two of the best places to go with questions are the Intel Fortran forum and the comp.lang.fortran newsgroup (yes, apparently, Usenet still exists).


Tagged with: , , , , ,
4 comments on “Too Much Confusion
  1. Stefano says:

    I agree with you, but I would like to highligth two aspects:

    + Fortran is the best programming language for scientific applications (and in general as a formula translator) fot its efficiency: almost all the compilers (free or not) are so much mature to produce executables being incredibly faster than all other languages…. even with respect C, that in general is used for building Fortran compiler :-). In my modest opinion, this is the KEY of Fortran success. Scientists are in general not nerd-programmers, but with Fortran it is very easy to obtain fast codes: some Fortran limits are for me its strongest features that allow extremely effiecient computations also for not nerd-programmers; in other words, I think that the Fortran succes is due not only to its absolute efficiency, but also to the simplicity in obtaining this high speed computation;

    + the older Fortran programmers who do not know (or better that want to know) that *goto* should be avoided are the main reason of Fortran bad knowledge: they see all Fortran 77+ improvments as uncessary and in general they see Fortran 2003+ programmers as stupid-not-so-nerd-to-use-C++ people… they are the main reason of the absence of a wide Fortran community.

    As John Bakus said, I do not know how will be the scientific program language of the future, but its name will be Fortran.

  2. Stefano says:

    Hi Jacob,

    I have read a thread (!topic/comp.lang.fortran/SC7FlYSg7kA) talking about the same concept of your article. I have linked your article as an example of good answer, I hope you do not mind of that.

    See you soon.

  3. Zaak says:

    Just FYI, I don’t think Intel is F2003 compliant yet. They still have not implemented parameterized derived types.

  4. Jacob says:

    I thought they did add that recently…but not sure.

Leave a Reply

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