[Coco] GOTO and code maintainability

Aaron Wolfe aawolfe at gmail.com
Mon Sep 7 15:45:01 EDT 2009

On Mon, Sep 7, 2009 at 9:26 AM, Aaron Banerjee<spam_proof at verizon.net> wrote:
> All of us have at least at one point in time either used, or tried to figure
> out code containing GOTO statements.  In a recent programming environment I
> was in, GOTO (or it's equivalent in whatever language we happened to be
> programming) was expressly forbidden -- no exceptions no matter what.
> Just to be an irritant, I chucked a single GOTO (to make a polling loop) in
> a relatively simple program, which totally confused my colleagues.
> Given that it isn't abused, I don't see why GOTO makes code any less
> maintainable than other obviscation techniques, such as polymorphism (which,
> while useful, if abused can lead to very multiple inheritance or
> exception-based program control.  At least GOTO tells you where it is
> going....
> Has anyone else run into this type of "GOTO intolerance" while programming?

I had an instructor years ago who liked to insist that GOTOs were
basically the root of all evil.
I had a feeling that he was wrong, but I didn't have the experience
(or cojones) to make an argument in GOTO's defense.  If only I had
read Donald Knuth's excellent article back then...


This is the most well reasoned opinion on GOTO I have read.  Mr. Knuth
is one hell of a smart guy (I am still struggling my way through his
"Art of Programming" books).  In a nutshell, people who forbid the
GOTO are just as silly as those who use them when they are not needed.

-(another) Aaron

>                          - Aaron
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco

More information about the Coco mailing list