Mail Archives: djgpp/2000/08/04/05:45:20
In article <4 DOT 3 DOT 2 DOT 7 DOT 0 DOT 20000803161722 DOT 00aa8bf0 AT mail DOT subdimension DOT com>,
Matt Lewandowsky <djgpp AT delorie DOT com> wrote:
>I was just pointing out that getting into the habit of using goto makes it
>far too easy to short-circuit things that the programmer *was* clueful
>enough to do.
My point is that goto is an undeserving bete noire of programmers. If
you're clueful enough to use malloc() instead of static arrays, use
malloc() instead of static arrays. If you're clueful enough to use goto
instead of making your code potentially tortuous to get yourself out of,
say, an error, or a NULL-pointer return or some such, then use goto. If
you're not clueful enough to do either, consider retiring to Visual Basic.
Of course goto makes it more likely that you'll do something stupid. Using
C makes it so much likely anyway, though, that the extra tiny margin isn't
worth consigning a useful programming construct to the dumper for.
This is going to turn into a holy war, isn't it? goto always gets this bad
press, and whilst I always try and avoid its use, I don't mind using it if
need be. You're the atheist, I'm the utilitarian :)
Anyway, I'll put an "OFF TOPIC" up there so people can ignore it if they
want. And I'll put a quick "swear word" in here - damn - to stop it from
ending up in the mailboxes of people on the mailing list. I'm surprised
goto *itself* isn't a swear word :)
J-P
- Raw text -