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 disagree. One of the only good things about older conventional
Fortran was the numeric labels. If more constructs besides
GOTO and DO used them it would have been an improvement.
With numeric labels you can keep them in order and that helps
navagate the code. Alphabetic labels could be ordered too, but
people tend to try to find names instead. Hence they are no
particular use in finding your way around the code.

--
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare


.


Quantcast