Re: Good Use of GOTO

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jim Brown wrote:
> 
> c.k.lester wrote:
> > 
> > Jim Brown wrote:
> > > 
> > > Perhaps you could cite the arguments (at least the ones you feel the most
> > > pertaint)
> > > and give your counter-responses.
> > 
> > There are counter-arguments to all the arguments in each of those links. No
> > need to rehash them here... is there? I simply remain unconvinced.
> 
> I read through all three links (the fourth one i visited was some stuff about
> DB and SQL...)
> 
> There were no successful counter-arguments presented. The conclusion was
> always
> that goto was useful in making code nicer.

There were plenty of successful counter-arguments. It's just that neither side
seems to be listening to the other.

I thought that the most relevant point was brought up in one of the articles
where "if C had exception handling then you wouldn't need goto".

I think I read the first three articles and skimmed the fourth, BTW.

> 
> > 
> > > We keep hearing this, yet when CChris asked for modern examples of
> > > spagetthi
> > > code abuse from languages which do support goto (such as C), he got
> > > nothing.
> > > 
> > > The burden of proof is now on you to show that this is the case....
> > 
> > <a
> > href="http://en.wikipedia.org/wiki/Spaghetti_code">http://en.wikipedia.org/wiki/Spaghetti_code</a>
> 
> The wikipedia link explains the concept but contains no examples (as of the
> time of this posting).
> 
> > I have no idea what this is saying: <a
> > href="http://sourcemaking.com/antipatterns/spaghetti-code">http://sourcemaking.com/antipatterns/spaghetti-code</a>
> 
> It appears to describe the pattern, like the wikipedia link, but again has no
> real live examples.
> 
> Java spagetthi code does not require the use of GOTO, and therefore does not
> count.
> 
> > <a
> > href="http://www.reddit.com/info/6l7dr/comments/">http://www.reddit.com/info/6l7dr/comments/</a>
> > 
> 
> This last mentions PHP spagetthi code. Like the Java example, non sequtior -
> it does not apply. PHP doesn't have a goto statement.

The request for modern examples of spaghetti code is a moot point because most
people know it is bad or should be used very sparingly. So even when goto is
available, it is used sparingly.

If Euphoria had been originally written containing goto we wouldn't be arguing
about it, now would we?

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu