🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #4392

Re: GOTO controversy

#4392
From: Dan Hicks
Date: Mon, 11 Mar 1996 03:56
19 lines
1544 bytes
In <Do2J4D.J4K@cix.compulink.co.uk>, jdm17@cix.compulink.co.uk ("John Meredith") writes:
>
>If a routine needs to perform some cleanup before returning
>and there may be occasions where an early RETURN is required
>(e.g. errors), then GO TO to transfer to a single clean-up-
>and-return code block is neater than multiple copies of said
>block.  Of course if the clean-up is complex, it would warrant
>being a separate (internal?) procedure.

What would be better here would be a language that provided proper 
structure -- ie, an Exit block that would always be executed when the 
associated block is exited, whether by RETURN, GOTO, or exception.  I 
once kludged this up with a macro processor and it did wonders for 
recovery-intense code -- made for much cleaner, more structured code. 
(Ran like a pig, but that was mostly due to the kludgy implementation. 
And where we used it performance wasn't that much of an issue.)

Dan Hicks
http://www.millcomm.com/~danhicks/
Technical Details
Message-ID: <4i08a3$n9a@misery.millcomm.com>
Path: arc1-ca.pugleaf.net!misery.millcomm.com!usenet
References: <4grt4e$8fg@goanna.cs.rmit.EDU.AU> <4hl8mt$4po@newshost.cyberramp.net> <wallaceDnvoEo.7L7@netcom.com> <Do2J4D.J4K@cix.compulink.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!misery.millcomm.com!usenet
From: danhicks@millcomm.com (Dan Hicks)
Newsgroups: comp.lang.misc,comp.lang.c,comp.lang.pl1
Subject: Re: GOTO controversy
Date: 11 Mar 1996 03:56:51 GMT
Organization: Millennium Communications, Inc.
Message-ID: <4i08a3$n9a@misery.millcomm.com>
References: <4grt4e$8fg@goanna.cs.rmit.EDU.AU> <4hl8mt$4po@newshost.cyberramp.net> <wallaceDnvoEo.7L7@netcom.com> <Do2J4D.J4K@cix.compulink.co.uk>
Reply-To: danhicks@millcomm.com
NNTP-Posting-Host: dial-13.roch.millcomm.com
X-Newsreader: IBM NewsReader/2 v1.2