From: Pascal J. Bourguignon on 24 Apr 2010 08:16 "Alexei A. Frounze" <alexfrunews(a)gmail.com> writes: > On Apr 24, 3:13�am, "io_x" <a...(a)b.c.invalid> wrote: >> [Xpost to: alt.comp.programming, alt.lang.asm, >> comp.lang.c, comp.lang.c++, comp.programming] >> >> the people that speak not good about "goto" >> are uttled wrong; their code bug full etc >> >> more distant is your code from goto >> more your code is bug full and incompresible >> >> the "goto" is the key word for programming; >> all the remain, other than goto or jmp or jc or jz, >> and the easy cpu layout >> is the wrong way for programming >> >> i advise all you >> Good Morning > > Everything may be used, misused and abused, goto included. There are > good and bad usage patterns and goto is not an exception here. I can > list a number of other things that may be just as bad as a poorly used > goto (or as good as a good goto). See? Indeed. For example, the Duff device is worse than most gotos I've ever seen. -- __Pascal Bourguignon__
From: Leigh Johnston on 24 Apr 2010 08:20 "spinoza1111" <spinoza1111(a)yahoo.com> wrote in message news:051fa27d-5cf8-4f7e-94c8-e9e5b26566b7(a)g34g2000pro.googlegroups.com... > On Apr 24, 6:06 pm, Ali Karaali <ali...(a)gmail.com> wrote: >> I use goto to break nested for loops and I can't see a >> reason to ban goto. > > Why not use break instead? Does the same thing, spares you from having > to define a label. > Because break only breaks out of the innermost loop, using goto to break out of nested loops is one of the few sensible uses of goto. /Leigh
From: Rui Maciel on 24 Apr 2010 08:20 io_x wrote: > [Xpost to: alt.comp.programming, alt.lang.asm, > comp.lang.c, comp.lang.c++, comp.programming] > > the people that speak not good about "goto" > are uttled wrong; their code bug full etc > > more distant is your code from goto > more your code is bug full and incompresible > > the "goto" is the key word for programming; > all the remain, other than goto or jmp or jc or jz, > and the easy cpu layout > is the wrong way for programming > > i advise all you > Good Morning I see there is a small misconception in this issue. The only nasty thing that is usually said about goto is that it's use may end up generating code which isn't easy to read, to interpret and to follow. Adding to that, high level languages implement multiple flavors of conditionals and loops, which end up performing the exact same tasks goto is used for but in a way which is "cleaner", easier to read, to interpret and to follow. Yet, loop/conditionals aren't and be all, end all solution. Some tasks, such as state machines, can still be better implemented with the plain old goto, sometimes in a "cleaner" way than with any mix of loop/conditionals which are available in any high level language. So, in essence, goto isn't the problem nor is it a problem. It's just a way of performing certain tasks. Sometimes it isn't the best tool and sometimes it isn't the worst tool. Nonetheless, that doesn't make it bad. On the other hand, popular misconceptions which are often cited but aren't based on any objective reasoning can constitute a problem, and this appears to be one of those cases. Rui Maciel
From: Daniel T. on 24 Apr 2010 10:10 "io_x" <a(a)b.c.invalid> wrote: > [Xpost to: alt.comp.programming, alt.lang.asm, > comp.lang.c, comp.lang.c++, comp.programming] > > the people that speak not good about "goto" are uttled wrong; their > code bug full etc > > more distant is your code from goto more your code is bug full and > incompresible > > the "goto" is the key word for programming; all the remain, other than > goto or jmp or jc or jz, and the easy cpu layout is the wrong way for > programming > > i advise all you > Good Morning This is probably a troll, but it is a good opportunity to suggest to everyone who is tempted to argue about this issue to start from Dijkstra's paper rather than simply asserting that "goto is good" without understanding the issues involved. http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_ Harmful.html
From: bartc on 24 Apr 2010 10:38
"Daniel T." <daniel_t(a)earthlink.net> wrote in message news:daniel_t-623394.10103424042010(a)70-3-168-216.pools.spcsdns.net... > "io_x" <a(a)b.c.invalid> wrote: >> the "goto" is the key word for programming; all the remain, other than >> goto or jmp or jc or jz, and the easy cpu layout is the wrong way for >> programming >> >> i advise all you >> Good Morning > > This is probably a troll, If this actually is io_x, then he really believes this stuff. > but it is a good opportunity to suggest to > everyone who is tempted to argue about this issue to start from > Dijkstra's paper rather than simply asserting that "goto is good" > without understanding the issues involved. > > http://www.u.arizona.edu/~rubinson/copyright_violations/Go_To_Considered_ > Harmful.html And then read Knuth's "Structured Programming with go to Statements" (a bad scan is here: http://pplab.snu.ac.kr/courses/adv_pl05/papers/p261-knuth.pdf) "... programmers and language designers still feel the need for some euphemism that 'goes to' without saying 'go to' ..." -- Bartc |