Re: Good Use of GOTO
- Posted by Jim Brown <jbrown105 at linux?uddhist.n?t> Jun 06, 2008
- 840 views
c.k.lester wrote: > > Anyway, I prefer the one without the GOTOs as it's easier to parse. > > In the one with GOTOs, at first glance, I would assume that all that code > is going to be called. But then I see the label "out" line. Now I have to > go back up into the code and find a GOTO (or more). This is, of course, a > simple example. I would HATE to see GOTOs in a function bigger than the > simple one you've posted. It's a matter of style. With the proper indentation, you should be able to spot them immediately. Without it, the nested ifs are signficiantly harder to read. Hitting Ctrl+F or otherwise using the Find/Search facility of your IDE or text editor shouldn't be that hard either...