Re: GoTo in Java
- From: mwojcik@xxxxxxxxxxx (Michael Wojcik)
- Date: 19 Jan 2006 19:58:11 GMT
In article <dqlv91$or$1@xxxxxxxxxxxxxxxxxxxx>, "Chuck Stevens" <charles.stevens@xxxxxxxxxx> writes:
>
> Personally, I think labelled EXIT PERFORM would raise more problems than it
> would solve.
If it was restricted to inline PERFORM, I don't see any problem; that
is, it doesn't seem to me to be any more pernicious than the average
construct now available. Certainly it can be abused, but what can't?
I'll note that labelled break and continue in Java have not caused
any particular grief in that language. (Frankly, as far as code
readability goes, I think Java's worst problem is the inclination
among many of its practitioners to write lines of a hundred
characters or so. The whitespace shortage is over, folks.)
> Even EXIT PERFORM <integer>, where <integer> is the number of
> levels to "exit", might be easier to define and less prone to errors
That's worse, IMO, because it's fragile. If code is refactored and a
level is added or removed to a nested PERFORM with a multilevel EXIT
PERFORM, then that magic number is suddenly wrong.
And numbered EXIT PERFORM is just labelled EXIT PERFORM with
potentially meaningful labels dropped in favor of forcing the code
maintainer to count levels. Make the compiler do the work, not the
programmer.
(If I were writing a language, actually, I think I'd require *all*
loops to be labelled, and the loop terminator would have to specify
the label. If the programmer is putting in a loop, it should be a
loop over something; let's make that explicit.)
--
Michael Wojcik michael.wojcik@xxxxxxxxxxxxxx
Thanks for your prompt reply and thanks for your invitatin to your
paradise. Based on Buddihism transmigration, I realize you, European,
might be a philanthropist in previous life! -- supplied by Stacy Vickers
.
- Follow-Ups:
- Re: GoTo in Java
- From: Frank Swarbrick
- Re: GoTo in Java
- From: Chuck Stevens
- Re: GoTo in Java
- From: Chuck Stevens
- Re: GoTo in Java
- References:
- GoTo in Java
- From: Howard Brazee
- Re: GoTo in Java
- From: Peter Lacey
- Re: GoTo in Java
- From: Howard Brazee
- Re: GoTo in Java
- From: Tiberiu Gociu
- Re: GoTo in Java
- From: Howard Brazee
- Re: GoTo in Java
- From: Chuck Stevens
- GoTo in Java
- Prev by Date: Re: [experiences] Fujitsu NetCOBOL for .NET
- Next by Date: Re: GoTo in Java
- Previous by thread: Re: GoTo in Java
- Next by thread: Re: GoTo in Java
- Index(es):
Relevant Pages
|
|