Idea for the adventurous: Write a Fortran program that uses all features of the language, parses the text of the standard, parses its own source code, and ensures it’s standard conforming.
Could be easier (?) with the 1957 FORTRAN… Smaller language at that time…
@vmagnin and everyone who has posted thus far:
At a somewhat deeper level, the question really ain’t how many times has one learnt Fortran. Rather, it’s how many programming paradigms does one pick up whilst using computing to solve problems over a fair duration of time.
The responses thus far are typical of how the computing education system in technical domains has been over the last few decades.
So one picks up basics of
procedural programming in the “early” days, a paradigm foundational to FORTRAN up to the FORTRAN 77 revision.
Then one starts to combine the procedural approach with aspects of good coding practices (GCP) as termed also as
modular programming styles as these became better supported by Fortran 90/95 standards.
Object-oriented programming paradigm and
functional programming aspects becomes viable with Fortran 2003.
Parallel programming, at least in the SPMD mode with the PGAS model. got standardized and refined with Fortran 2008 and 2018 respectively.
The good thing is Fortran has continued to evolve toward a multiparadigm programming language.
The unfortunate part though is that Fortran has appeared a hesitant and a rather slow follower of the trends in technical computing and mostly lost its presence in academia and many parts of industry.
The paradigm of
generic programming (which can be kinda seen as
templated metaprogramming also) should also have been on the list above. But current standard only includes rudimentary support for some aspects with subprogram (procedural) genericity. One now has to hope Fortran 202Y will provide the needed facilities but with robust and reliable compiler support for that likely only around year 2035 How many here will truly be “coding in anger” a decade and a half from now!?
The “story” with Fortran could have been a lot different with many, many more scientists and engineers, at least those on the brighter side of mid-30s, having formally learned the multiparadigm approach with all of the paradigms I list above and their applications in scientific and technical computing from the get-go early in their academic career. Alas, that is not the case.
I took an Intro to Fortran course my first semester of college (2005). I didn’t get back to programming at all until my first job in 2011. At that point I was basically just programming (and learning) Fortran 90, but really just free format FORTRAN 77.
A couple years later I started learning Python, getting better at bash, sed, awk, and a bit of Perl. At that point I came back to Fortran trying to apply some the techniques and practices I learned in those other languages, and was happy to find the later standards (03/08) supported much of what I wanted.
So I would say I’ve learned (or come back to learning) Fortran 3 times now. But I’d say it’s learning other languages that pushed me to learn more.
In 1977 in my second year at uni (QMC, London) we were taught Ratfor because it should help us to write better structured programs than the wild lands of raw Fortran that we had to use in 1978. For a long time compilers came with a Ratfor front end but I don’t think that’s the case anymore.
@FortranFan has a valid point, at least for me it never felt like I relearn a language but more like a gradual process of discovering more possibilities and applying them to my projects. Only recently I hit a point with Fortran where there seems to be no more to discover and the language sometimes feels incomplete or clunky.
But maybe I’m not long enough around here, judging from the other comments. I started in 2017 basically from scratch using a C++ tutorial but coding it up in Fortran, it was a great C++ tutorial because it was a guide on electronic structure methods and (procedural) programming and I had to learn both at this point. From there I started gradually learning Fortran by trial-and-error, compiler warnings and existing source code while discovering and applying new concepts.
At least for me the biggest change in my perception of Fortran (and programming languages in general) was joining the open-source community in 2019 by pushing my first real-world project on GitHub. I was expecting to get a lot of response on the implementation, source code, whatever… instead I got questions about installation, compilers and deployment. To me it felt like Fortran was never the problem, just the tooling (in fact it turned out there are good tools for Fortran around).
I first “learned” FORTRAN in 1981, during a degree in Physics, probably using NOS on a CDC mainframe, through a terminal (check out http://bitsavers.org/pdf/cdc/cyber/nos/60435400J_NOS_Version_1_Reference_Volume_1_Aug79.pdf for user-friendliness). It was horrific and I retreated to BBC Basic.
10 years later I was employed by NAG Ltd, whose Algol, Fortran, C, Ada, etc numerical libraries had made a splash since the 70s. One of my colleagues, Malcolm Cohen, was writing a Fortran 90 compiler, the very first one to appear. 30 years on, I am still learning Fortran from the Standard that he edits and the book that he co-authored with Michael Metcalf and John Reid. I have a few iterations of that book: the “revised edition, Fortran 8x Explained” from 1989 is the oldest of the editions in my library, the very first one was based on the first draft of the f90 Standard, dated 1987.
If I remember well, I had some F77 lectures during my master in 91-92 (DEA at this time in France), maybe before, but I’m not sure. Then, I’ve used it during my master project in theoretical chemistry and later one during my PhD (93-96). When, I’ve got my permanent academic position, I’ve started to write research codes (in quantum dynamics) from scratch in F77.
Around 2004, I’ve moved those codes in f90, using dynamical allocations, modules, derived types, overloading… I don’t remember, the book I’ve used. I still have it, but in my office!
Recently in 2016, I did follow a 3-days f2003 lecture from a computational center in France (IDRIS). I was mainly interested by the oriented object features. Now, I’ve started using these OOP features for a new code.
I first learned Fortran IV in my first year of university (in 1982/83). Then I relearned what was presented to us as Fortran 77 with the Vax/VMS extensions in master (1987), for projects (gas accretion on binary stars). During my thesis, I discovered a lot of tricks thanks to the reading of a galaxy photometry code. Afterwards, while developing my own N-body and hydrodynamics codes, I followed the evolutions to Fortran 90, then 95, by following trainings by HPC computing centers to facilitate learning. Now, I am slowly initiating myself to Fortran 2008. You learn all the time with Fortran
I learned fortran the first time in 2000 for my undergraduate thesis, with a good set of lectures notes on Fortran 90 from some British university. In that occasion I had no idea of how OOP was supposed to work and I made all sorts of weird architectural decisions, learning the hard way why data hiding matters. During the PhD I acquired a modular coding style and started using OO more. In my second postdoc, in view of contributing to a demanding ERC project, I looked for some source of best practices and stumbled across “Code Complete 2”, which I loved becaused it contained most of the practices that I had converged towards on my own. I also wrote some parallel PETSc code, which is its own dialect. Since I am not using much more than MPI for what I do, I would like to learn more about co-arrays in the most recent standards of the language. When co-arrays came out, I remember reading some comments from Steve Lionell about them not being quite there yet (I think he was referring to performance). Time has passed and it looks like the language is mature for practitioners to enjoy it. I have ordered a couple of copies of Milan’s book, one for me and one for my future postdoc (if and when I’ll find one). Amazon is due to deliver them this afternoon: Christmas!
Yes. Malcolm Cohen has very likely read the whole standard for 2008 and 2018 (as the editor for those documents).
I’ve learned several languages, all named Fortran. Starting with IBM Fortran IV in 1968 (for IBM 1130, while in high school), then the same language in the 1969-1970 school year, intro college programming (for freshmen), with the WATFOR/WATFIV compiler. [The assigned textbook was the IBM FORTRAN Language Reference Manual.] Later in undergraduate college, I “upgraded” to the IBM G and H compilers, all on the college’s central IBM 360/65. Grad school in 1973 brought a Univac 1108 with Fortran 5, and later a VAX 8600 (bought by our research group in physics) with DEC Fortran (a definite step up). The VAX was the first system without a card reader. At Cray, I started programming in parallel with coarrays in the late 1990’s with the Cray Fortran90 compiler. Subsequently, Fortran 2003, 2008, and now 2018 (compiler name changed to just “ftn” to avoid having to change it with each new standard).
I knew QBASIC and Pascal from the early '90s, but I picked up Fortran around 2006 at school. Even though there was Fortran 2003, people used to teach FORTRAN77 (shockingly, some still do). It was not a good experience until I started self-educating myself on Fortran 2008. It took me a few years to realize that the use of lower-case characters was not heresy in Fortran. Since then, I have learned and taught several other programming languages at school. But Fortran still remains my favorite. I am glad that @milancurcic and others took the initiative to start the fortran-lang community. This was something that I always felt missing in my early days of learning Fortran. Modern Fortran 2008/2018 is a great language for scientific computing, but it needs (modern) missionaries to show its greatness to others.
It’s interesting to see that all generations are present in our community. It’s a great richness for sharing knowledge.
When I was studying at the Faculty of Chemistry, UNAM, I discovered Fortran 77, but I didn’t like it, I felt that it was very old, but in a book I discovered Fortran 90, and there I fell in love with the language and decided to learn it. I started with Chapman’s Fortran 90/95 book (Fortran 90/95 for Scientists and Engineers) and a Visual Studio 6.0, using Array Visualizer. It was great. Then I had to learn FORTRAN 77 for a job for a research institute. When I learned Java and C ++, I wanted to see the potentialities of Fortran with respect to OOP, I read "Object-oriented Programming via Fortran 90/95 "From Ed Akin. Then I got really excited about the capabilities of Fortran 2003 and started studying it, also with Chapman’s book, but the third edition. For now I have not studied Fortran 2008 and Fortran 2018, I hope have a time in the future. For now they go 3 times.
My first Fortran encounter was a course taken in 1977 or 1978 when I started my university education. So it must have been still F66. The final project was realized on a mainframe computer taking up whole story of a building. With punched cards as the source input. So I knew exactly what did the “fixed form” mean Some time around 1990 I started to teach F77 to the students of the very same department (astronomy) and have been doing so ever since (also C), gradually upgrading to F90/95 and further. The new standards I learned (well, still learning) by myself in a sort of continuous self-education.
Surely I do appreciate the modern Fortran features but I also value the F77 simplicity which made this language an ideal choice for teaching “programming” to people who had never programmed before (which was and still is the great majority of students starting the first year of the university). One could easily learn F77 in one semester (60 hours). With the modern versions this is hardly possible. And still, the vast library of astronomical software still in use is mostly F77.
I wonder if Fortran 77 was so simple. You need to know for example about leading and physical dimensions of arrays when passing them to subroutines, and passing x(1) to a subroutine could mean either passing a scalar or effectively passing a pointer to an array. Fortran 90+ assumed shape arrays are simpler to teach and use.
Languages such as Matlab were created partly because many undergraduates were unproductive in FORTRAN IV or 77. A Fortran 95 subset such as F or ELF90 could probably be learned in the same time as F77. A book I liked was Essential Fortran 90 & 95 (1997) by Loren Meissner.
Two times. First time was in high school, back in … it must have been 1988 or 1989, last year of high school. I liked they way the teacher taught us how to deal with vectors and matrices, but spent way too much time on formatted input and output without ever mentioning free format which was a deterrence for me and I started coding in C instead, soon to switch to C++.
But, in spite of my fluency with C/C++, upon joining Delft University of Technology in 1997, I was forced to go back to FORTRAN 77 because the lab head of the time wanted to understand every piece of code written in his lab and he only knew FORTRAN 77. In spite of frustration and disappointment, I had to do it if I wanted to keep the job. But I can’t say I learned FORTRAN for the second time, I simply started to code in it and that was it. I was more focused on MPI and parallelization because I was coding for a Cray T3E.
After completing my PhD in 2001, I left Delft, left FORTRAN too, changed a couple of jobs and was using C++ for most the projects I was involved in. And that’s how it was for almost two decades, until 2018 when a young Russian lad joined my lab in Switzerland (where I still work) because he was using the code I developed in Delft for his research, and thought I would help him to implement certain physical models. But then something unexpected happened. When we opened the old sources, when I saw the code I was writing almost two decades back, I became very emotional, it was like travelling back in time, nice memories from the Netherlands came rushing back, memories of my young wife (we divorced since) and my two baby daughters … it all came back and the old code became my obsession. I was helping the young Russian lad as much as I could, but was at the same time refactoring the code using the best of my capabilities, relying heavily on the book: “Object-Oriented Programming via Fortran 90/95” from Ed Akim. That was the second time I learned Fortran, and boy did I love it. On one hand I was modernizing something which I created almost two decades ago, but I also loved to see how Fortran developed, and my mind felt liberated from all the intricate complexities of C++. Fortran now had objects (which were still pseudo-objects in Akin’s book but I could see where it was going), but I didn’t have to think which headers to include, shall I make an
STL class or not, shall I pass arguments by value or by reference (all is reference in Fortran but is hidden from you - great), shall I define member function as
const or not, shall I use pointer (
*) or reference (
&), and yeah … never forget that although you have
N entities in your container, they start from
0 and the last one is
N-1. (I know there are workarounds, but it’s undeniable they require extra effort and add complexity).
I would be very cocky to claim that I know enough, the second step of learning Fortran is a continuous process to this day, and I hope for many years to come
Concerning that point, you can find some interesting discussions here:
Note also that the interoperability with C introduced the
value statement to pass an argument by value. But it is not limited to calling C functions and can be used in other cases.
See for example: IBM Docs
Thanks for this additional info. My point was, however, that I am actually happier with fewer options in a computing language, at least in this stage of my life and career. If I have constantly have to make choices in my brain: “by reference or by value?”, “pointer or reference”, “can this member function be declared const or not?”, “do I need to include mathc or stdlibc?” my mind is constantly being distracted and eventually need more time to solve a problem at hand. Put on top constant e-mail notifications, meeting reminders, messages you receive on your phone, I don’t need additional “clutter” from the programming language.