Fortran-202X-Proposals icon indicating copy to clipboard operation
Fortran-202X-Proposals copied to clipboard

GENERAL CONCEPT: How to discourage/remove implicit save & streamline variable initialization?

Open zbeekman opened this issue 6 years ago • 5 comments

My proposal in #12 was infeasible as @milancurcic pointed out.

So far two possible options are

  1. Make obsolescent variable initialization during declaration (because these variables get the implicit save attribute

  2. Add an additional attribute to allow variable initialization during declaration that would make the variable a non-saved 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.

zbeekman avatar Jul 26 '17 17:07 zbeekman