Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

GOTO

Name: Anonymous 2007-01-29 2:03

My C++ professor stated that it is taboo if you use the GOTO statement in code. Tell me /prog/, is GOTO as bad as he says? What's your opinion on it?

Name: Anonymous 2007-01-30 5:42

If you truly want your program to run forever, there is no substitue for goto.

i.e.

endless:
doSomethingEternally();
goto endless

beats

do {
doSomethingEternally();
} while ( true );

You can see how goto is superior as there is no way to break out of the loop short of a interrupt.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List