From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1d321b3a6b8bcab2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-28 08:35:35 PST Path: swrinde!pipex!warwick!not-for-mail From: csusb@csv.warwick.ac.uk (Jules) Newsgroups: comp.lang.ada Subject: Re: "Subtract C, add Ada" Date: 28 Jan 1995 16:35:21 -0000 Organization: University of Warwick, Coventry, UK Message-ID: <3gdro9$aud@spam.csv.warwick.ac.uk> References: <3fo2ot$su2@miranda.gmrc.gecm.com> <3fode9$dap@soleil.uvsq.fr> <3g1shu$ksc@rational.rational.com> NNTP-Posting-Host: spam.csv.warwick.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: 1995-01-28T16:35:21+00:00 List-Id: In article <3g1shu$ksc@rational.rational.com>, davidm@rational.com (David Moore) writes: >It is also easy to write abominations like: > > -- search the table > > while (a[i++]!=b); > >Whenever you use post-increment in a condition, you always have to stop and >wonder about your post-condition - I find it easier to always write the >loop out in full. It is also easy to write stupid code like this when NOT using shorthand code like this. Of course the correct version (and the version I still prefer) is: while (a[i++]!=b && i < ARRAYLIMIT); -- /* Julian R Hall csusb@csv.warwick.ac.uk Flames should be redirected to /dev/null - I don't know what I'm saying myself so don't expect it to make sense all the time! */