[Coco] C VS Basic Coco
William Astle
lost at l-w.ca
Wed Feb 14 12:29:29 EST 2018
On 2018-02-14 10:06 AM, Bill Gunshannon wrote:
> Ask Dykstra. Or just look at the decades of research into why GOTOs are
> bad.
> In one of my last professional programming gigs I took more than a dozen
> programs heavily laced with GOTOs (true spaghetti code!!) and using proper
> structured programming removed all of them. While I am not one who heavily
> favors standards bodies I think when they decided to come up with a BASIC
> standard it should have deprecated the GOTO entirely.
Unrestrained use of GOTO is definitely bad. Especially when you have
better alternative control structures (FOR, WHILE, etc.) and proper
blocking that hide underlying GOTO business.
However, there are some cases where it can serve to make the code flow
clearer.
Note that I'm not advocating for the use of GOTO everywhere. I'm simply
saying that getting rid of it entirely is a bit like throwing the baby
out with the bath water. Is it strictly required? No. Is it useful
sometimes? Yes.
More information about the Coco
mailing list