Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

I don't agree `goto` is all bad. Whilst the OP said there are exceptions, they didn't list them. An ideal use (in C) is to ensure that in an error state, resources are cleaned up properly by jumping to error handling code (within the same function).


view as:

Or you have a case where a function must be restarted at a new state. Recursion is not always desirable here. intrafunctional gotos, used sparingly, are quite helpful.

Legal | privacy