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,2746dae4f161c04e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-21 20:23:34 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Understanding Booleans Date: 21 Nov 2001 20:23:34 -0800 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0111212023.17ab963d@posting.google.com> References: <20011121.053507.496987743.3460@web.de> <3BFBDF14.4B83708B@boeing.com> NNTP-Posting-Host: 205.232.38.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1006403014 14091 127.0.0.1 (22 Nov 2001 04:23:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 22 Nov 2001 04:23:34 GMT Xref: archiver1.google.com comp.lang.ada:16823 Date: 2001-11-22T04:23:34+00:00 List-Id: Jeffrey Carter wrote in message news:<3BFBDF14.4B83708B@boeing.com>... > Preben Randhol wrote: > > > > if Get_Active (Object) = True then > > Am I the only one who finds this objectionable? It ends > up meaning the > same thing as > > if Get_Active (Object) then Absolute rules of style are the hobgoblins ... OK you know the quote. But it really is appropriate here. Write whatever is clearer to the reader, and do not think you can avoid the obligation of figuring out what is clearer by having absolute rules. if At_End_Of_File = True then seems redundant, indeed, though objectionable seems a strong term to use On the other hand if Status_Flags (X) = True then may be quite clear, depending on the context ... if External_Data = True then would also seem OK to me. Where possible choose predicate like names for tests and then you definitely do not need the "= True". A related query arises with A := (b = c) or (e = f); some people prefer to write if (b = c) or (e = f) then A := True; else A := False; end if; And often people object, but I find that sometimes the extended form is clearer (boolean values are perfectly ordinary values from a language point of view, but not from a normal conceptual point of view, they are rather special :-)