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: dewarr@my-dejanews.com Subject: Re: Bit manipulation facilities in Ada Date: 1998/11/22 Message-ID: <739bfk$u0g$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 414486318 References: <36573C4D.DA431821@physics.purdue.edu> <737gmk$9f1$1@nw001t.infi.net> X-Http-Proxy: 1.0 x13.dejanews.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sun Nov 22 15:43:46 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1998-11-22T00:00:00+00:00 List-Id: > 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. 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! 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