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-Thread: 103376,36b302576d78847a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!atl-c08.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: How do you bitwise operations in Ada '83 and '95 References: From: Stephen Leake Date: Sun, 23 Jul 2006 11:59:43 -0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:K/2FQDgEWe1WxXw7xmpop+YrY+o= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 0fd1e44c39cf0e084460632120 Xref: g2news2.google.com comp.lang.ada:5888 Date: 2006-07-23T11:59:43-04:00 List-Id: Simon Wright writes: > Stephen Leake writes, responding to me: > >>> I have a feeling that shift&mask ends up more understandable >> >> Never. >> >>> and reviewable. >> >> In Ada 95, maybe. In Ada 2005, not. > > Really, understandable and reviewable are very similar, so I don't see > how something could be (possibly) more reviewable while never more > understandable. Hmm. To me, "understandable" means "expressed in terms I am familiar with, using idioms I am familiar with, and unambiguous". Or something like that. While "reviewable" means "traceable to source documentation". So if I am familiar with the Ada 95 idiom for endianness-independent rep clauses, they are "understandable". But because they are complex, they may be less reviewable. I've never done a _formal_ review (trace to source docs) of any software, so I'm on shaky ground here. > Seriously, the C > > field = (longword >> 15) & 0x3f; > > is pretty clear. At the bit level, yes. But if the 7 bits are supposed to represent some object, actual names would be far preferable. -- -- Stephe