|
|
Back to UserFriendly Strip Comments Index
|
goto | by perldude | 2002-06-11 09:00:28 |
|
There are several cases where goto is appropriate. | by Yohimbe | 2002-06-11 09:19:09 |
|
nested structures | by perldude | 2002-06-11 09:31:02 |
|
Well, assembly and machine code have no while() | by Yohimbe | 2002-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 Yohimbe | 2002-06-11 10:25:12 |
|
Think he would have been more justified... | by HadEnuf | 2002-06-11 10:27:18 |
|
*ow my brains* | by i_am_pi | 2006-11-19 12:55:59 |
|
Why, hello, Mr. Gumby! (n/t) | by HadEnuf | 2002-06-11 11:03:02 |
|
|
[Todays Cartoon Discussion]
[News Index]
|
|