Article View: comp.lang.misc
Article #994Easy to read conditions (was Re: do...while vs. repeat...until)
From: Martin Weitzel
Date: Thu, 22 Mar 1990 19:08
Date: Thu, 22 Mar 1990 19:08
14 lines
1228 bytes
1228 bytes
In article <16249@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes:
>[.....] I claim that, to me, the condition "(c >= 'a' && c <= 'z')" is a
>simpler expression than "(c < 'a' || c > 'z')". I immediately recognize the
>idiom in the former, but the latter causes a perceptible delay as I mentally
>translate the condition.
Why not "('a' <= c && c <= 'z')" ?
This duplicates the mathematical notation "lowest <= x <= highest"
to specify a range very closely. It's equally easy to ready if you
want to exclude one of the limits from the range - simply change
"<=" to "<".
--
Martin Weitzel, email: martin@mwtech.UUCP, voice: 49-(0)6151-6 56 83
Technical Details
Message-ID:
<690@mwtech.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!unido!mikros!mwtech!martinReferences:
<16188@haddock.ima.isc.com> <9130009@hpavla.AVO.HP.COM> <OVB2S3Bxds13@ficc.uu.net> <16249@haddock.ima.isc.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!unido!mikros!mwtech!martin From: martin@mwtech.UUCP (Martin Weitzel) Newsgroups: comp.lang.misc Subject: Easy to read conditions (was Re: do...while vs. repeat...until) Message-ID: <690@mwtech.UUCP> Date: 22 Mar 90 19:08:43 GMT References: <16188@haddock.ima.isc.com> <9130009@hpavla.AVO.HP.COM> <OVB2S3Bxds13@ficc.uu.net> <16249@haddock.ima.isc.com> Reply-To: martin@mwtech.UUCP (Martin Weitzel) Organization: MIKROS Systemware, Darmstadt/W-Germany Lines: 14