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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: Patrick Logan Subject: Re: Software landmines (loops) Date: 1998/09/07 Message-ID: #1/1 X-Deja-AN: 388605938 References: <6sh3qn$9p2$1@hirame.wwa.com> <6shbca$66c$1@news.indigo.ie> <6shhq7$lut$1@hirame.wwa.com> <6sjbso$1lk$2@news.indigo.ie> <6sjijg$36r$1@hirame.wwa.com> <6skhcm$1dr$2@news.indigo.ie> <6skqf3$9g0$1@hirame.wwa.com> <6smmhv$1kp$1@nnrp1.dejanews.com> <6smsi3$n8i$1@hirame.wwa.com> <35EEBA15.30C3CC76@tisny.com> <6sn2lv$t6m$1@hirame.wwa.com> <35F24AC9.40FE817C@earthlink.net> <6su6kg$d5t$1@hirame.wwa.com> Organization: Teleport - Portland's Public Access (503) 220-1016 NNTP-Posting-Date: Sun, 06 Sep 1998 22:49:31 PDT Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-07T00:00:00+00:00 List-Id: : >> doit := (A is right); : >> doit := doit and (B is right); : >> doit := doit and (C is right); : >> if doit then do the work; This violates one of the principles I try always to follow: single assignment. Unless a variable is in a loop, being updated to reflect the state of the loop, I will never assign a second value to it. If I wanted the form above, I'd rephrase it like this: boolean a_ok := (A is right); boolean b_ok := a_ok and (b is right); boolean c_ok := b_ok and (c is right); if c_ok then do the work; But I don't like this form anyway because it makes me wonder why test for b_ok if it has already been established that a_ok is false. This is so far away from the idioms I use all the time that it makes me wonder what was one the developer's mind and what I might not be correctly understanding. -- Patrick Logan (H) mailto:plogan@teleport.com (W) mailto:patrickl@gemstone.com http://www.gemstone.com