Fortran-202X-Proposals
Fortran-202X-Proposals copied to clipboard
GENERAL CONCEPT: How to discourage/remove implicit save & streamline variable initialization?
My proposal in #12 was infeasible as @milancurcic pointed out.
So far two possible options are
-
Make obsolescent variable initialization during declaration (because these variables get the implicit
save
attribute -
Add an additional attribute to allow variable initialization during declaration that would make the variable a non-
save
d variable.
In my opinion the number one draw back of Fortran is its verbosity (including a lack of generic programming facilities). Disallowing variable initialization during variable declaration (1) will necessitate an additional line of code to perform the initialization assignment, and adding an extra attribute (2) to prevent implicit save
still necessitates more typing.
Upon further consideration, (2) has now become my preference since multiple variables could be declared and initialized on the same line, requiring the addition of only 1 extra word (the new attribute). IMO this is more compatible with the "don't repeat yourself" (DRY) principle.