Re:Coding style and undoing indentation hell
by lfaraone on Friday June 01, 2012 @01:36PM
(#4054594)
I stopped reading when he recommended if-goto.
[ Parent
| on HN ]
Re:Coding style and undoing indentation hell
by bingaling on Friday June 01, 2012 @04:25PM
(#4055557)
Usage of goto is fine (the effects are easily understood) when the destination only points to lines ahead of the goto, within the same block.
In this case, it makes the control flow more readable.
What if it were called "try/finally" instead?
Re:Coding style and undoing indentation hell
by DeepDuh on Saturday June 02, 2012 @11:09AM
(#4058219)
I read the comments just expecting yours. Something must obviously bad if Dijkstra says so, right? We don't have to think for ourselves anymore if the god of CS himself has banned something, right?
Sure, goto was abused, but it's no worse than (or even better than) using continuations or using break and continue.
Any of those mysterious jump-to-somewhere-else code features resemble goto. Not that I don't think they clean up some nesting issues, but they're pretty much the same thing as goto.
Re:Coding style and undoing indentation hell
by huhtenberg on Friday June 01, 2012 @05:44PM
(#4055994)
Too bad, because it's the only sensible advice in the whole post.