Writing Fortran in a new $LANGUAGE is a great way to learn the language. “Fortran” is pretty simple. Simple Fortran is simple. Things like COMMON blocks and COMPLEX numbers don’t move well, but the rest does. It’s a solid “lowest common denominator” language and has the significant broad concepts (variables, expressions, iteration, I/O – these will take you far).
Some languages are more accommodating than others, but nevertheless it gives you a leg up in adopting that language.
Simply, when approaching a new language, just try to do a 1:1 translation of Code You Know in $YOUR_LANGUAGE, and convert it in to $LANGUAGE. In the end, you should have something that works, that translates what you knew in the old language in to constructs in the new language.
What you don’t have, in the end, is an idiomatic version of your code. But that’s OK. Because now you can hit the same code again, but this time from a point of view of adding $LANGUAGE idioms and constructs in to your “working code”.
There’s still hurdles not doubt. Especially some of the modern functional languages etc that don’t look at all like what you’re used to. But when you’re “uplifting” something from a less expressive language to a more expressive language, then, ideally, you should be able to more or less get a pretty much straigh across conversion.
I liken this experience to what I had learning Lisp and Scheme. These languages always flumoxed me, reading them I would see concepts that were simply opaque to me, mostly because of the vocabulary used. Everyone loves LAMBDA, CDR, CAR, CADR.
But then I ran across a book “Simply Scheme”.
Simply Scheme used it’s own vocabulary early on. Its skipped the opaque, meaningless words. The word LAMBDA actually has a lot of history and weight behind it, and carries implications with it. But if you don’t know it history, at a glance, you’re pretty much out of luck.
Acting as a Rosetta Stone of sort, Simply Scheme jumped over that problem. Once I essentially learned “Lambda” meant “function”, it was an AHA moment and I could then proceed to write “Fortran in Scheme/Lisp”.
Much akin to “make it work, then make it fast” you can apply “make it work, then make it idiomatic”.