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: 103376,1922c4740861327c X-Google-Attributes: gid103376,public From: Ole-Hjalmar Kristensen Subject: Re: Bit manipulation facilities in Ada Date: 1998/11/24 Message-ID: #1/1 X-Deja-AN: 415156738 X-NNTP-Posting-Host: fwall.clustra.com References: <36573C4D.DA431821@physics.purdue.edu> <737gmk$9f1$1@nw001t.infi.net> <739bfk$u0g$1@nnrp1.dejanews.com> Newsgroups: comp.lang.ada X-Complaints-To: abuse@telia.no Date: 1998-11-24T00:00:00+00:00 List-Id: dewarr@my-dejanews.com writes: > > Robert T. Sagris wrote in message > > <36573C4D.DA431821@physics.purdue.edu>... > > I'm thinking about taking an Data Security and > > Encryption course. > > The language for programming projects is open to the > > students. > > > > The Professor has already recommended C for its built in > > Bit operators. > > But I would like to try it in Ada, as I've never used in > > a class. > > I could use the practice. > > > > Robbi Sagris > > > Ada is far better than C for this purpose. In addition to > all the general (and quite correct) propaganda about the > general superiority of Ada, there is one particular feature > that is missing in Ada, namely packed bit arrays. In C you > have to program this your self, as an array of bytes, which > you then do bit manipulation on. > Ever heard of bit fields in C? > This is less efficient than the Ada code, results in much > more obscure code, and is much more error prone. > > Undoubtedly the Professor's recommendation simply comes > from ignorance of this feature of Ada! > Agreed. > Regarding other facilities, Ada and C are pretty much > equivalent in terms of low level facilities. Both give the > choice of using bit operations on integer values, or of > declaring records with bit fields. > > But for the applications in question here, the packed array > feature is a very critical one. You will find it far easier > to program these problems in Ada, even if you are less > familiar with Ada than with C (the effort of learning Ada > will easily be repaid!). > > Robert Dewar > > -----------== Posted via Deja News, The Discussion Network ==---------- > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own