Re: "GOTO considered harmful" considered harmful. Re: New style DO syntax?



Kevin G. Rhoads wrote:
The parenthetic DO could include an end label something like this:

DO (I=1,10,END=100)
N(I)=1
100 CONTINUE

However, I would expect that all other block constructs should then have the same option for using an end label.


Fine, but then generalize the labels to be alphanumerics, perhaps terminated by a single colon.
MHOO: The main problem with goto targets in Fortran is not the GOTO, it is the numeric labels.
"GOTO considered harmful" considered harmful.

I suggested generalizing text labels some time ago, with the idea that construct names already set a precedent for using name-based labels. Many people simply dislike the idea just because it seems anti-FORTRAN. One person stated a dislike for text labels because it means having to take time to think up names for all those label numbers. With that way of thinking, why bother to name variables? You could have integers I1, I2, I3, ... In.

As for ideas like "GOTO considered harmful", there are people that take it too seriously. Things like GOTO, EQUIVALENCE and global variables are only bad when they obfuscate the code, which is easy to do if these are used excessively. Using a named label for GOTO helps keep it from being obfuscated, but useful comments can also do this.

In any case, it seems that the Fortran Standards are in the process of making block constructs more uniform, so constructive discussions here may actually have an influence.

Joe
.