3 ms·
The main difference between functions and subroutines in Fortran and other ancient programming languages is not the fact that subroutines do not have a return v
by adrian_b 11mo ago
The main difference between functions and subroutines in Fortran and other ancient programming languages is not the fact that subroutines do not have a return value.
The functions of Fortran are what would be called pure functions in C (which can be marked as such with compilers that support C language extensions, like gcc).
The pure functions cannot modify any of their arguments or any global variable, and they must be idempotent, which is important in program optimization.
- pklausler 11mo agoThis is complete misinformation and you should stop posting it. One can explicitly declare a function (or subroutine) to be PURE in Fortran, but it is not the default and never has been.