comp.lang.ada
 help / color / mirror / Atom feed
From: Chris Brand <cbrand@ccgate.hac.com>
Subject: Re: Ada 83 - avoiding unchecked conversions.
Date: 1996/12/12
Date: 1996-12-12T00:00:00+00:00	[thread overview]
Message-ID: <32B062D3.7E9A@ccgate.hac.com> (raw)
In-Reply-To: mheaney-ya023280001112962007210001@news.ni.net


Matthew Heaney wrote:
>
[cut]
> But knowing the representation of the data is only important at the
> hardware level, ie "the interface boundary."  Internal to the software
> there's a lot going on that doesn't depend on representation of the data,
> so we want to practice some information hiding by letting the compiler
> choose the representation.
> 
[cut]
> 
> This confusion is also the reason why shops often say "Thou shalt not use
> predefined types, because it's not portable."  This too is another silly
> rule.
> 
> It would be perfectly valid for such a rule at the interface layer, because
> I have to know the representation of my types.  But internal to the
> software system, I don't care, and using predefined types is just another
> form of information hiding.
> 
[examples cut]

I worked on a project where the rule was not to use predefined types.
We had a package defining the "base types" to use, with all their
representation clauses and everything and we had to base our types on
these.
The main type was an "Integer_16".

This was great while we were using a 286 target. It was only when we
ported
it to a 486 target (where 16-bit values need more work than 32-bit ones)
that we noticed the disadvantage of such a rule. Left to itself, the
compiler would have chosen a 16-bit value for most things on the 286 and
a 32-bit value on the 486.

Of course, if you take these things away, people have to think about
"what is a sensible upper bound for this type ?" :-)

-- 
Chris
Stating my own opinions, not those of my company.




  reply	other threads:[~1996-12-12  0:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <md5:8B831999BCF200C6E70994BDF6CC529F>
1996-12-11  0:00 ` Ada 83 - avoiding unchecked conversions Chris Sparks (Mr. Ada)
1996-12-11  0:00   ` Dewi Daniels
1996-12-12  0:00     ` Richard Kenner
1996-12-17  0:00       ` Eric Miller
1996-12-18  0:00         ` Robert Dewar
1996-12-18  0:00           ` Robert A Duff
1996-12-19  0:00           ` Keith Thompson
1996-12-26  0:00             ` Robert Dewar
1996-12-11  0:00   ` Matthew Heaney
1996-12-12  0:00     ` Chris Brand [this message]
1996-12-13  0:00       ` Stephen Leake
1996-12-14  0:00         ` Robert A Duff
1996-12-14  0:00     ` BGaffney42
1996-12-19  0:00   ` Robert I. Eachus
1996-11-27  0:00 Ensco Vendor
1996-11-27  0:00 ` Robert I. Eachus
1996-11-29  0:00 ` Robert Dewar
1996-12-01  0:00   ` Darel Cullen
1996-11-30  0:00     ` Robert Dewar
1996-12-11  0:00     ` Richard Riehle
1996-12-02  0:00 ` Ted Dennison
1996-12-10  0:00   ` Matthew Heaney
replies disabled

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