[Coco] GOTO and code maintainability
os9dude at gmail.com
Tue Sep 8 08:40:55 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
> Has anyone else run into this type of "GOTO intolerance" while programming?
> - Aaron
To be honest, I never understood the backlash GOTO suffered from structured
language evangelists, I felt it was to be taken as the one and only
source/cause of spaghetti code; that was the rhetoric from the uprising
Pascal and C community back in college (mid 80's for me)... my generation
had been brought up with TRS-80 Basic and 6800 ML assembly and that made us
all of the sudden the old guys who knew nothin' about programmin'.
Same could have been said about the IF THEN ELSE construct with its implied
GOTOs, yet no one raised a ruckus over that... GOTO was the four letter word
to be wary about. Sigh...
More information about the Coco