comp.lang.ada
 help / color / mirror / Atom feed
From: dewarr@my-dejanews.com
Subject: Re: Bit manipulation facilities in Ada
Date: 1998/11/22
Date: 1998-11-22T00:00:00+00:00	[thread overview]
Message-ID: <739bfk$u0g$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 737gmk$9f1$1@nw001t.infi.net


> 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    




  reply	other threads:[~1998-11-22  0:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-21  0:00 Bit manipulation facilities in Ada Robert T. Sagris
1998-11-21  0:00 ` Srinivasan, R
1998-11-22  0:00   ` dewarr [this message]
1998-11-22  0:00     ` Simon Wright
1998-11-23  0:00       ` dewarr
1998-11-24  0:00         ` P.S. Norby
1998-11-23  0:00     ` Marin David Condic
1998-11-24  0:00     ` Ole-Hjalmar Kristensen
1998-11-24  0:00       ` John McCabe
1998-11-22  0:00 ` Matthew Heaney
1998-11-22  0:00   ` dewarr
1998-11-22  0:00 ` The Ludwig Family
1998-11-23  0:00   ` dennison
1998-11-22  0:00 ` Robert T. Sagris
1998-11-23  0:00 ` Robert I. Eachus
1998-11-24  0:00 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox