Debunking the anti-GOTO/GOSUB vendetta

Many “experts” are now on some strange vendetta against GOTO and GOSUB; each has convincing-sounding reasons why these commands shouldn’t be used for various reasons in computer programs.   Rather than argue for or against these reasons, I will simply present the following fact:   GOTO and GOSUB work fine if you have designed your program to use them.   However, if you haphazardly use GOTO and GOSUB to skip around in a program, they can cause problems.   They are neither always bad or always good, just as any programming construct can be abused, but I would not discourage anyone from using one if it makes sense to use… provided that you understand how they work (obviously, it’s the same rule with any programming construct).

The moral: a poorly designed program will have errors of all kinds, including GOTO/GOSUB abuses.   A well-designed program, however, can use these commands without logical or architectural penalty.

Devin

Leave a Reply

You must be logged in to post a comment.