Earl J. Morris on Fri, 28 Jul 2000 19:22:36 -0400 (EDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] 'goto' in C code


On Fri, 28 Jul 2000 14:24:59 -0400, you wrote:

>Does anyone have a reason why goto should not be used in C code ??
>
>I like to use it for error handling, but a couple managers where I work
>have this idea that the goto keyword should never be used, although they
>can't offer any reason why. I have heard before that it's not good
>practice, but I've never heard a valid reason why. Can anyone shed some
>light ?

Yo!
  Excessive use of the "goto" could make code hard to follow and the logic
difficult to see. However, if used with care, it can make the code very
efficient. As an example; use a "switch()" instead of multiple "if() goto"
statements.

 As an aside, managers usually get to be managers because of their ability to
follow rules and lack of imagination.
  

______________________________________________________________________
Philadelphia Linux Users Group       -       http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion   -   http://lists.phillylinux.org/mail/listinfo/plug