Article View: comp.std.c
Article #3995Re: Situation indicators (long) (was: How to eliminate GOTO?)
From: Paul Long
Date: Thu, 14 Sep 1995 17:50
Date: Thu, 14 Sep 1995 17:50
33 lines
2043 bytes
2043 bytes
A.Main@dcs.warwick.ac.uk (Zefram) wrote:
>When used with a loop construct, the situation identifier is just a
>break. The (already suggested) syntax that would attach an optional
>label to each loop, and allow break and continue to use that label,
>would be more general (because continue works),
>and wouldn't complicate
>the grammar nearly as much.
That's for sure.
>When used with an arbitrary statement, the
>situation identifier merely acts as a goto to the end of the statement,
>which I think is sufficiently rarely used
I couple of weeks ago, I would have agreed with you. Recently, however, from
articles posted here, private correspondence, and a couple of books (_Windows
95_ and _Code Complete_). I've discovered that this is a common idiom for error
handling. I think that there are much better solutions, but apparently
(otherwise :-) ) good programmers goto the bottom of a function to handle all
errors encountered in that function. Situation indicators would, IMO, be a
slight improvement.
>that another syntax for it
>would not be useful.
"Useful," I think so; "warranted," maybe not.
--
Paul Long 45:29:14N 122:48:09W
plong@perf.com http://www.teleport.com/~pciwww/
"Where time or intelligence are lacking, a goto may do the job."
- M.E. Hopkins, "A Case for the GOTO," 1972.
Technical Details
Message-ID:
<439q12$p7o@news0.rain.rg.net>Path:
arc1-ca.pugleaf.net!usenet.eel.ufl.edu!pacifier!rainrgnews0!usenetReferences:
<4321kd$cne@news0.rain.rg.net> <1995Sep12.171404.21373@dcs.warwick.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!usenet.eel.ufl.edu!pacifier!rainrgnews0!usenet From: Paul Long <plong@perf.com> Newsgroups: comp.std.c Subject: Re: Situation indicators (long) (was: How to eliminate GOTO?) Date: 14 Sep 1995 17:50:26 GMT Organization: Performance Computing Incorporated Message-ID: <439q12$p7o@news0.rain.rg.net> References: <4321kd$cne@news0.rain.rg.net> <1995Sep12.171404.21373@dcs.warwick.ac.uk> NNTP-Posting-Host: yosemite.perf.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.1 sun4c) X-URL: news:1995Sep12.171404.21373@dcs.warwick.ac.uk