Back in the 1990’s, I pursued doctoral studies in medical physics. As part of covering my tuition fees, I performed routine clinical tasks in diagnostic radiology and radiation oncology. One of my duties was devising plans for treating prostate cancer patients with tiny radioactive sources. The planning process involved determining the number of radioactive sources required for treatment as well as ascertaining their optimal locations in 3D space. Manually devising the treatment plans was a tedious, time consuming process. The computers of that era consisted of 486 and first-generation Pentium microprocessors. Multi-core processors were unheard of, at least in the public arena.
For my doctoral project, I decided to develop software for automating the treatment planning process. Optimized treatment plans would be generated by computer in the OR while the anesthetized patient was on the table. OR time is expensive and procedures needed to be performed in a timely manner to make way for the next scheduled procedure. One may safely classify a hospital OR as a high-pressure environment.
Patient outcomes depend on high quality implants and OR time is a limited resource. Hence the software not only had to find the best achievable dose distribution, it had to do so as quickly as possible. To meet these objectives, I investigated available compiler options. Back in the 90’s, C++ was the craze and I was all set to code the dosimetry routines and genetic algorithm in C++. I contacted a company that specialized in computational numerics, selling custom numeric processing hardware and optimizing compilers targeting numerics. As it turned out, I spoke with the president of the company and discussed with him what I wished to achieve. Naturally I expressed interest in his company’s C++ compiler.
His reply to my inquiry caught me completely by surprise. Yes, he told me, he could sell me his C++ compiler if that is what I really wanted. If, however I really need maximum execution speed, he suggested I code my project in Fortran. In my admitted ignorance, I never imagined that the source programming language mattered any. I figured that all compiled code needed to end up as x86 machine code irrespective of the source programming language. My B.S. and M.S. degrees were in electrical engineering, not computer science. It occurred to me that I still had a lot to learn despite having several years of programming experience under my belt. The company president offered to mail me (I had yet to have an email address) literature on his compiler offerings and I took him up on his offer. I would be lying if I said I was not skeptical regarding his claim favoring Fortran. Sure, Fortran compilers have their place. With millions of lines of Fortran code still in use, that code would inevitably need to be migrated to new hardware. Nonetheless, I would never have entertained coding a new project in Fortran.
In the 1980’s, I spent many an hour behind key-punch machines, line printer terminals and eventually VT-100 terminals. Most of my time was spent working on DEC 20’s and DEC VAX computers. Save for key-punching, I really enjoyed running Fortran-coded simulations on those machines. However, in the late 1980’s with affordable PC’s, Turbo C and Microsoft C, I naturally started coding in C at my first job. I never considered going back to Fortran. On the other hand, if the president of a company specializing in numerics tells me that Fortran is better than C++, I should take his recommendation seriously.
It happened that I had access to Microsoft C version 5 as well as Microsoft Fortran version 5. To me it seemed that I could make a fair language comparison considering that in all likelihood, both compilers were using the same back end. I wrote a few nested loops in both languages and compiled the C and Fortran versions using the same compiler switches. It turned out that the compiled Fortran ran 13% faster than the compiled C version of the program. These results convinced me that the company president had a point to consider. I thus began looking forward to receiving his literature.
A few days following my conversation with the company president, an oversized document envelope awaited me in my mailbox. Not only did he include information concerning his compiler offerings, he also added a white paper on the new Fortran 90 standard. I already knew about Fortran 90 and that it contained user-defined data types. What I did not know were its array handling capabilities and its elemental functions. For me, the array processing features the language offered out of the box convinced me to go with Fortran-90. I placed an order for the Fortran-90 compiler and never looked back. The prostate software I wrote was in routine clinical use for more than a decade after I graduated. Thirty years later, now approaching retirement, I decided to begin teaching Fortran online. Only at the time of this writing, the latest version of the language is Fortran 2023 and it is still going strong.