August 15, 2003
> > I like goto.
>
> And I like McDonald's BigMacs, but it doesn't mean they're good for me.

Your analogy is not well founded. There are no circumstances under which a Big Mac is appropriate. Even if you do eat meat (though I cannot imagine anyone wishing to do so), then there are better forms of meat. Even if you do need a hamburgler, then there are less mass-produced, healthier, and (from what my carnivorous friends tell me) tastier alternatives.

What we're talking about here is something that is almost always bad, but sometimes very good. A better analogy in this case would be a can of Coke. Bad in almost all conceivable circumstances, but if you've got a cycling-<substitute your sport of choice here, so long as it's not golf!>-headache, then the combination of water, high concentration of simple carbohydrates and big shot of caffeine are exactly appropriate. Rehydrates, gives your brain some well needed carbs, and opens up the blood vessels in the old grey matter to assuage the ache until the rehydration kicks in. Marvellous!

Derek the Dietician


August 15, 2003
"Matthew Wilson" <matthew@stlsoft.org> wrote in message news:bhi0gn$1uf0$3@digitaldaemon.com...
>
> > > I like goto.
> >
> > And I like McDonald's BigMacs, but it doesn't mean they're good for me.
>
> Your analogy is not well founded. There are no circumstances under which a Big Mac is appropriate. Even if you do eat meat (though I cannot imagine anyone wishing to do so), then there are better forms of meat. Even if you do need a hamburgler, then there are less mass-produced, healthier, and (from what my carnivorous friends tell me) tastier alternatives.
>
I think the analogy is actual perfect, and proved by your responce, unless you see goto as a good "meat" !


August 15, 2003
> > > > I like goto.
> > >
> > > And I like McDonald's BigMacs, but it doesn't mean they're good for
me.
> >
> > Your analogy is not well founded. There are no circumstances under which
a
> > Big Mac is appropriate. Even if you do eat meat (though I cannot imagine anyone wishing to do so), then there are better forms of meat. Even if
you
> > do need a hamburgler, then there are less mass-produced, healthier, and (from what my carnivorous friends tell me) tastier alternatives.
> >
> I think the analogy is actual perfect, and proved by your responce, unless you see goto as a good "meat" !

I don't eat any dead walking (or flying) things, so cannot say that I do. ;)


August 15, 2003
Matthew Wilson wrote:
> "Frank D. Wills" <fdwills@sandarh.com> wrote in message
> news:bhh9ic$1853$1@digitaldaemon.com...
> 
>>I suppose the goto statement isn't a big issue, but it's the
>>first thing I would want to remove from all languages except
>>it's equivalent, the jump statement on assembler, where it's
>>needed. Otherwise nothing worse or uglier than a goto statement.
> 
> 
> Don't mean to offend, but this sounds terribly naive. Just because something
> is rightly deprecated in most circumstances does not mean it does not have a
> use. I rarely use it, probably a couple of times a year, but when I do it is
> the appropriate tool for the job in hand, so I use it.
> 

Niave? You've got to be kidding!

August 15, 2003
Matthew Wilson wrote:
> "Frank D. Wills" <fdwills@sandarh.com> wrote in message
> news:bhh9ic$1853$1@digitaldaemon.com...
> 
>>I suppose the goto statement isn't a big issue, but it's the
>>first thing I would want to remove from all languages except
>>it's equivalent, the jump statement on assembler, where it's
>>needed. Otherwise nothing worse or uglier than a goto statement.
> 
> 
> Don't mean to offend, but this sounds terribly naive. Just because something
> is rightly deprecated in most circumstances does not mean it does not have a
> use. I rarely use it, probably a couple of times a year, but when I do it is
> the appropriate tool for the job in hand, so I use it.
> 

The use of a goto statement is a hack, a kludge-fix for
a lack of logic and structure. I hope that doesn't sound
too terribly naive.


August 15, 2003
Matthew Wilson wrote:
>>>I know, but still, "goto" is part of the language.
>>>
>>
>>Yes, but that neither compels you to use it, or to make it a part of your
>>'language'.
> 
> 
> If it's in, then its use should make sense.
Alcohol and cigaretts are legal. Does that make
their use sensible? Teenage pregnacy is legal. Does
that also make teenage pregnacy legal? A lack of
education beyond highschool is legal. Does that
make a lack of further education sensible?
Really, what is allowed and what is wise and good
are not the same thing, and only the ignorant
think otherwise.
Oh, by the way, I don't mean to offend by calling
you ignorant.
> 
> (Not that I'm coming down on any side of the goto debate here.)
> 
> 
Not coming down on any side of the goto debate? Even when you
say that it's "terribly naive" to wishing that modern languages
did not implement goto? And that you defend your use of goto
as appropriate?

August 15, 2003
Frank D. Wills wrote:
> Matthew Wilson wrote:
> 
>>>> I know, but still, "goto" is part of the language.
>>>>
>>>
>>> Yes, but that neither compels you to use it, or to make it a part of your
>>> 'language'.
>>
>>
>>
>> If it's in, then its use should make sense.


> Alcohol and cigaretts are legal. Does that make
> their use sensible? 

I *love* good red wine! So yes.
And i don't have anything against people who smoke. Here in Germany I've spent quite some time with girls who do. :)

> Teenage pregnacy is legal. Does
> that also make teenage pregnacy legal?

What's so special about it? Jewish girls may marry from the age of 13 onwards. That means it would quite make sense for them to become pregnant by, say 16.

> A lack of
> education beyond highschool is legal. Does that
> make a lack of further education sensible?

For some poeple yes. Some people just feel better when they do routine jobs, then when they have to think.

You *are* naiive!

> Really, what is allowed and what is wise and good
> are not the same thing, and only the ignorant
> think otherwise.

Forbidding stuff will not give us much. Look at Eiffel, and if you still like "forbid-it-all" parctice, go ahead and use it!

> Not coming down on any side of the goto debate? Even when you
> say that it's "terribly naive" to wishing that modern languages
> did not implement goto? And that you defend your use of goto
> as appropriate?

Look at the Linux Kernel. :)

There arre plenty of languages which consider themself "safe" and thus firbid it. D has another purpose: it has to be fast and fun and reasonably safe... It has to appeal to both Java and C++ users, and be in 99,9% cases better than these languages. You know: no risk - no fun. :)

It is our task to find other fun ways, which lead to less risk. This "go to is harmful" is from the time BASIC ruled (early, non-structured dialects!), and code was so full of GoTos that the style got its name - Spaghetti code. Unreadable. These times, use of GoTo is structured and rare, and does not sacrifice readability of code. If you read any good C++ book or FAQ, you will find an up-to-date list of "no-nos", which is dominated by much more severe problems these days. D strives to be an intuitive solution to them -- and there are still many which D wouldn't solve!

Not that i would like D much, but i believe the direction it is heading to is right and good for it, and goto simply belongs to it.

-eye/MIDICLUB

August 15, 2003
On Fri, 15 Aug 2003 16:59:33 +1000, "Matthew Wilson" <matthew@stlsoft.org> wrote:

>If it's in, then its use should make sense.

I agree. goto should either be taken out of the language or it should be able to accept an empty statement (without the kludges of requiring a semicolon or a zero). Personally, I think it should stay, but I wouldn't be too disappointed if there was no goto.

--Benji Smith
August 15, 2003
Benji Smith wrote:

> I agree. goto should either be taken out of the language or it should
> be able to accept an empty statement (without the kludges of requiring
> a semicolon or a zero).

WAIT A MOMENT! What do you think an empty statement looks like? Either {} or ; but } is not an empty statement

From the parsing point of view, label would need to be a stetement all by itself, i don't know whether this imposes any problem. Or } should be interpreted as ;} which should work OK.

I just can't understand what's wrong about:
...
	jump_out: ;
}


-eye/MIDICLUB

August 15, 2003
It does.

The goto statement is the direct equivalent of the assembler jmp opcode, the most fundamental control transfer structure bar none.

Higher-level control constructs should be used when possible.  But goto exists to allow making of new control constructs (if we had some kind of macro facility, which we don't) and to get you out of pickles where the nice "high-level" control constructs don't work and aren't getting the job done.

Believe it or not, C does not provide all the control constructs you'll ever need, unless you count goto.

Sean

"Frank D. Wills" <fdwills@sandarh.com> wrote in message news:bhilbg$2hmo$1@digitaldaemon.com...
> Matthew Wilson wrote:
> > "Frank D. Wills" <fdwills@sandarh.com> wrote in message news:bhh9ic$1853$1@digitaldaemon.com...
> >
> >>I suppose the goto statement isn't a big issue, but it's the first thing I would want to remove from all languages except it's equivalent, the jump statement on assembler, where it's needed. Otherwise nothing worse or uglier than a goto statement.
> >
> >
> > Don't mean to offend, but this sounds terribly naive. Just because
something
> > is rightly deprecated in most circumstances does not mean it does not
have a
> > use. I rarely use it, probably a couple of times a year, but when I do
it is
> > the appropriate tool for the job in hand, so I use it.
> >
>
> The use of a goto statement is a hack, a kludge-fix for
> a lack of logic and structure. I hope that doesn't sound
> too terribly naive.