In contrast to many other languages, Fortran does not have any reserved keywords. Is that decision still considered today as good practice or is it just a legacy from being the first high level language?
Anyways, what are the pros and cons?
- New functionality can be added to the language without breaking backward compatibility (see how this is handled in Rust: Rust 2018 is here… but what is it? - Mozilla Hacks - the Web developer blog)
bessel_yo(X)) can be replaced if one has a faster implementation.
- Parsing Fortran code must be very difficult
Code can become obfuscated:
program main implicit none print*, if(.true.) ! 42.000 print*, 'real is ',real() ! 'real is god' contains function if(question) result(answer) logical :: question real :: answer answer = 42.0 end function function real() result(answer) character(len=3) :: answer answer = 'god' end function
One reason for not reserving keywords could be the large amount of intrinsic procedures and subroutines which compensate for the lack of a standard library.
I would be interested in getting your opinion in the poll or, even better, as a response.
Which handling of reserved keywords do you prefer?
- no reserved keywords
- only statements (e.g.
- statements and intrinsic procedures
Note: I don’t think reserving intrinsic features but not statements would be a sensible choice.