Re: Good Use of GOTO
- Posted by Greg Haberek <ghaberek at gm?il?com> Jun 06, 2008
- 843 views
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