Re: "GOTO considered harmful" considered harmful. Re: New style DO syntax?
- From: "James Giles" <jamesgiles@xxxxxxxxxxxxxxxx>
- Date: Wed, 26 Apr 2006 19:47:09 GMT
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
.
- Follow-Ups:
- Re: "GOTO considered harmful" considered harmful. Re: New style DO syntax?
- From: Joe Krahn
- Re: "GOTO considered harmful" considered harmful. Re: New style DO syntax?
- From: glen herrmannsfeldt
- Re: "GOTO considered harmful" considered harmful. Re: New style DO syntax?
- References:
- New style DO syntax?
- From: Joe Krahn
- Re: New style DO syntax?
- From: *** Hendrickson
- Re: New style DO syntax?
- From: Gordon Sande
- Re: New style DO syntax?
- From: James Giles
- Re: New style DO syntax?
- From: Gordon Sande
- Re: New style DO syntax?
- From: Joe Krahn
- "GOTO considered harmful" considered harmful. Re: New style DO syntax?
- From: Kevin G. Rhoads
- New style DO syntax?
- Prev by Date: Re: passing only the real parts of a complex array to a function
- Next by Date: Re: Function argument
- Previous by thread: Re: "GOTO considered harmful" considered harmful. Re: New style DO syntax?
- Next by thread: Re: "GOTO considered harmful" considered harmful. Re: New style DO syntax?
- Index(es):