The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

goto by perldude2002-06-11 09:00:28
  There are several cases where goto is appropriate. by Yohimbe2002-06-11 09:19:09
    The only reason I've ever seen goto's used are... by Nullmeister2002-06-11 09:30:22
      Well, yes, that's the most common case... (n/t) by Schol-R-LEA;22002-06-11 09:48:17
        yes... by Epiphany02002-06-11 09:52:44
          Can't blame you by Schol-R-LEA;2 2002-06-11 10:11:54
The few times I've seen gotos in working code, I reacted much the same way. On those occasions I can recall offhand, one was a higly optimized bit that, frankly, should have been redone in assembly anyway; aother was simply a bad piece of code that I ended up rewriting (I'm not exactly the best coder in the world myself, but I could see the flaw in what the other person had done pretty clearly).

The remainder were all cases of using it to escape from a deeply nested loop in a language (C, Pascal or Modula 2) that didn't support labelled breaks. While sometimes these could be redone, there were a few in which there was no obvious way of rewriting the loops to avoid it that wouldn't result in even worse maintanence problems. Sometimes, even the best principles need to be set aside for practical reasons.

The Modula-2 one surprised me, as there was an obvious, if somewhat clumsy, way to avoid it. It was in a tutorial (on recursive-descent compiler design), and didn't contribute to the speed to any significant degree, so it was particularly unjustifiable IMAO.
[ Reply ]
            yep by Epiphany02002-06-11 10:32:29
              There are a few optimizations that are universal.. by HadEnuf2002-06-11 10:36:45

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)