4 ms·
"And yeah, I remember that fill code. I always felt guilty because it contained a goto statement. I don't think I've written a "goto" since." Loved this! Glad
by edw519 13y ago
"And yeah, I remember that fill code. I always felt guilty because it contained a goto statement. I don't think I've written a "goto" since."
Loved this!
Glad I'm not the only one :-) My last goto statement was in 1984, rejected by Code Review.
I haven't written a goto since. And I haven't cared much for Code Review since, either.
- barrkel 13y agoGotos aren't that infrequent in C and C++ written without exceptions or longjmps, and stack-based cleanup needs to occur. Last time I wrote a goto in a language that did have exceptions was the alignment portion of an unrolled loop implementation of a hash algorithm. Delphi doesn't support C-style switch statements where one case flows into the next; so the alignment switch did jumps into the unrolled loop body.
- mratzloff 13y agoYep. Gotos can be the cleanest way of handling certain errors in C.
- kroger 13y ago"By the way, if you don’t like goto statements, don’t read this. (And don’t read any other programs that simulate multistate systems.)" Knuth, on the Adventure game [1] Knuth's "Structured programming with go to statements" [2] is always a good read. [1] http://www.literateprogramming.com/adventure.pdf http://www.literateprogramming.com/adventure.pdf [2] http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.103.6084 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.103.... EDIT: formatting