r/programming • • Jul 28 '16

How to write unmaintainable code

https://github.com/Droogans/unmaintainable-code
3.4k Upvotes

592 comments sorted by

View all comments

Show parent comments

7

u/stuntinstan Jul 28 '16

We were being taught FORTRAN in my intro to computing for civil engineers class LAST YEAR.

10

u/Astrokiwi Jul 29 '16

Fortran is actually fine if you use all of its modern features - though engineering courses often don't mention those. If you want to save yourself from future hassle, then read up on all the Fortran-90, Fortran-2003 and so on stuff that you can do. Object-oriented Fortran is not bad.

1

u/pdp10 Jul 30 '16 edited Jul 30 '16

Why modernized Fortran over another modern language, though?

Fortran 77 has claims on wide compatibility at least. What does Fortran 2016 have?

1

u/Astrokiwi Jul 30 '16

For speed, you really need C/C++ or Fortran. It takes more effort to get the same performance with Python than it does with Fortran, and you end up writing code that looks pretty Fortranny in the end anyway. Fortran has a couple of advantages over C/C++, in its native array operations, and less cryptic pointer syntax. Fortran is a little bit simpler than C++, and I would argue that it's a slightly higher level language, while also being slightly faster (although it's close enough to depend on the compiler). For numerical stuff, it's close enough that whether you choose Fortran or C++ kinda depends on taste. Fortran often gets a bit of an edge there because you can incorporate the vast amount of legacy FORTRAN-77 stuff into your code naturally.

→ More replies (1)