3 ms·
Young programmers hear that goto is bad and should never be used. They begin repeating this to others. Then the whole world thinks goto is bad, because 99% of d
by 16s 15y ago
Young programmers hear that goto is bad and should never be used. They begin repeating this to others. Then the whole world thinks goto is bad, because 99% of devs say so.
Then an expert, highly-regarded dev shows code that has useful goto statements. And only 1% of coders understand that this is perfectly acceptable. They know that goto is not evil (all the time) and is even very useful in certain cases.
- 5hoom 15y agoI think just the tiniest bit of experience with assembly would chase away a lot of unwarranted fears about goto. At that level it's all goto so you have to use them. And if you don't want your program to become a spaghetti nightmare you have to use them wisely. When using anything higher level you can & should use 'if', 'for', 'while', etc. but it's not like the world implodes if you use a goto in your code.