Article View: comp.std.c
Article #3420Re: GOTO single exit point (was: Re: How to eliminate GOTO?)
From: Peter Curran
Date: Thu, 14 Sep 1995 22:06
Date: Thu, 14 Sep 1995 22:06
32 lines
1942 bytes
1942 bytes
On 13 Sep 1995 08:10:47 GMT in article
<HOSHI.95Sep13171048@ext221.sra.co.jp>
hoshi@sra.co.jp (Hoshi Takanori) (Hoshi Takanori) wrote:
>In article <42s5su$4h8@inforamp.net> pcurran@inforamp.net (Peter Curran) writes:
>> I'm not sure that this is exactly how I'd write this in a real-world
>> situation, but it does the job without multiple returns and without
>> deep nesting.
>I think your code is _ugly_. It depends on the order of
>initialization of variables A, B, C. What if you cnage the
>order to A, C, B, or add a new variable D between A and B?
I would have to make some changes. The changes would be quite
obvious, and not the slightest bit more difficult to make than they
would be for a similar modification in any of the other versions that
have been presented - easier than some.
This is an artificial problem, and, as I said, the code I presented is
not exactly what I would write for a real-world problem. However, it
is quite unlikely that, in a real world problem, the type of changes
you are suggestion would arise. If the original problem, and
solution, has been defined intelligently, it is quite unlikely that
the need for a new variable will suddenly appear. That is, in my
experience, not that kind of changes that happens in real-world
development, and it is not the kind of maintenance for which my coding
style is optimized.
--
Peter Curran pcurran@inforamp.net
Technical Details
Message-ID:
<43a8ed$pqo@inforamp.net>Path:
arc1-ca.pugleaf.net!inforamp.net!usenetReferences:
<42s5su$4h8@inforamp.net> <HOSHI.95Sep13171048@ext221.sra.co.jp>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!inforamp.net!usenet From: pcurran@inforamp.net (Peter Curran) Newsgroups: comp.std.c,comp.lang.c Subject: Re: GOTO single exit point (was: Re: How to eliminate GOTO?) Date: Thu, 14 Sep 1995 22:06:18 GMT Organization: PSC Enterprises Message-ID: <43a8ed$pqo@inforamp.net> References: <42s5su$4h8@inforamp.net> <HOSHI.95Sep13171048@ext221.sra.co.jp> Reply-To: pcurran@inforamp.net NNTP-Posting-Host: ts5-09.inforamp.net X-Newsreader: Forte Free Agent 1.0.82