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
    nested structures by perldude2002-06-11 09:31:02
      Well, assembly and machine code have no while() by Yohimbe2002-06-11 09:54:28
        Actually, I doubt that "Dijkstra hates him"... by HadEnuf 2002-06-11 10:22:58
...since that's hardly a willy-nilly use of GOTO. And obviously (from my other posts) we agree on the potential use of break/last/continue/etc. to "uglify" as badly as GOTO.

Basically, I will use GOTO if either there is no other way to make the code readable (yes, I have seen this); or if it's absolutely necessary for a crucial optimization the compiler has no hope of catching. Otherwise, I prefer to avoid it.

I'll even admit to wrapping a few 'case's in a "do {} while 0;", so I could use 'break' to execute and 'continue' to skip a long "common tail", when no reasonable, naturally-existing state information could be used as a guard condition on its execution. Doing this is as much a sarcastic comment to the "goto-paranoid", as anything, though: the 'goto' is actually clearer, in this case.

(I've also wrapped nested 'case's in "do {} while 0;", so that I could use 'continue' to break out of the entire nest. Positively *evil*, isn't it?)

I wonder what Dijkstra would have made of Duff's Device?

--
HadEnuf?
[ Reply ]
          Dijkstra would have killed Duff on the spot (n/t) by Yohimbe2002-06-11 10:25:12
            Think he would have been more justified... by HadEnuf2002-06-11 10:27:18
          *ow my brains* by i_am_pi2006-11-19 12:55:59
            Why, hello, Mr. Gumby! (n/t) by HadEnuf2002-06-11 11:03:02

 

[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.)