Mail Archives: djgpp/2000/08/04/04:30:24
djgpp AT delorie DOT com wrote:
>One good reason to keep in mind: you may get into the habit of using it.
>And in C, it's a worse habit than BASIC. Let's say that you have an
>oft-used loop whose nesting make this one look simple. Let's say you want
>to break out of it simply. Lets say that you forgot there's a free() five
>levels out after this point. You use goto. See a potential problem?
>
>Wow. I've been reading too many "War On Drugs" propaganda items today,
>haven't I? Anyway, I *think* it's somewhat coherent...
I got you, don't worry.
But it's not very hard to take your point one little step
further: Don't break out of loops at all.
Sure, goto can be dangerous. But thinking about it: Name
just one element of the C-language that can not be
dangerous. Just one single element that let's you not do
something stupid.
The most harmless little thing I could think of is the
semicolon. But I often did stupid things with that. I guess
we all did:
if (something);
What else seems innocent? How about printf?
printf ("manni is a jerk");
Now that was stupid.
printf ("%d manni is a jerk %d");
Stupid and dangerous.
Ok, I'm blabbering, I know.
--
Manni
"Life would be much easier if I had the source code."
- Raw text -