Re: Good Use of GOTO

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu