eg0master
Posts: 161
Joined: 3/20/2002 From: Stockholm, Sweden Status: offline
|
Ah... stupid me... Of cause you visit the forum, check email etc the same way I do - during builds... I must start to trust humanity again... And I'm sad to say the GOTOs have not been outlawed... I see them quite often in open source C programs and once in a while a few programs that is not open source. Mostly the GOTOs are used in an acceptable manner, but once I stumbled across a piece of code where GOTOs where used to implement a while loop... All non-programmers ignore this:
some init code;
some more init code;
if (init failed)
goto cleanup; /* Acceptable use of GOTO, especially if there are a lot of these, but IF statements could be used */
retry:
do something;
if (something failed)
goto retry; /* Bad use since this is a while loop! */
cleanup:
cleanup after init;
_____________________________
24 hours in a day, 24 beers in a case. Coincidence? I think not.
|