Re: Good Use of GOTO

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

Derek Parnell wrote:
> 
> >   Lets add exit to avoid adding goto.
> > 
> >   Lets add retry to avoid adding goto.
> > 
> >   Lets add continue to avoid adding goto.
> > 
> > MORE keywords are CLEANER than one easy to understand KEYWORD?
> 
> In this case, yes. 
> 
> The main differenmce is that the 'goto' does not tell the code reader what the
> intentions of the original coder were. Whereas 'continue', 'exit', etc signal
> to the reader what the coder was attempting to achieve.

YES, this. This *exactly*. UNIQUE keywords with DEFINED behavior are a helluva
lot cleaner and simpler than a SINGLE keyword with an AMBIGUOUS behavior. As
Derek stated, they're also easier to understand by describing the code flow
within themselves.

-Greg

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

Search



Quick Links

User menu

Not signed in.

Misc Menu