comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeff Creem" <jeff@thecreems.com>
Subject: Re: Unchecked_Conversion
Date: Sun, 10 Jun 2001 19:48:01 GMT
Date: 2001-06-10T19:48:01+00:00	[thread overview]
Message-ID: <R9QU6.5064$Tc.1623474@typhoon.ne.mediaone.net> (raw)
In-Reply-To: 41F37C284A6DE8C0.8A6A99719FF11B52.8149DC60E20677C9@lp.airnews.net


"Robert B. Love " <rlove@antispam.neosoft.com> wrote in message
news:41F37C284A6DE8C0.8A6A99719FF11B52.8149DC60E20677C9@lp.airnews.net...
> In <LdLT6.2225$bA3.107918@www.newsranger.com> Ted Dennison wrote:
> > In article <9fnbtt$ild$1@e3k.asi.ansaldo.it>, Lele says...
> > >I should convert data types and record data types from one type to
> another,
> >
> > Just to back up Marc here, you should almost *never* have to convert
> types. The
> > only times I ever have to do it are when interfacing with external
> routines that
>
> My experience runs counter to this.  My employer has chosen to use
> typing for every conceivable measurement. So we have type Meters,
> Meters_Per_Second, Feet, Feet_Per_Second, Seconds, Watts, Volts, and so
> on.
> The list is endless.
>
> To avoid conversions I would have to have hundreds of overloaded
> operators.
> And to make matters worse, we have generic vectors that can be
> instantiated
> for the basic types above.  I would have to have overloaded operators for
> all the vector combinations.
>
> No, using Ada in my problem domain, you are constantly converting types.
> And it can be a pain.



Actually given the subject line I think the original poster was referring to
unchecked_conversion.
Certainly conversions are used. It is unchecked_conversion that is not
needed as often (typically).

As for your problem domain sounds like it is not Ada that is a pain but the
way you have
chosen to use it. I have gone back and forth for some time on the usefulness
of this
level of typing. The idea is that you can avoid certain classes of
programming errors by
having specific types for all of these physical units. The problem is of
course that people then
get so used to using type conversions in their daily programming that
conversions can then
be used to introduce the same bugs....Granted at least now it is more
explicit where each
possible error point is...





  reply	other threads:[~2001-06-10 19:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-07  7:46 Unchecked_Conversion Lele
2001-06-07 12:50 ` Why not try Checked_Conversion? Petter Fryklund
2001-06-07 13:01 ` Unchecked_Conversion Marc A. Criley
2001-06-07 13:21 ` Unchecked_Conversion Ted Dennison
2001-06-10 18:20   ` Unchecked_Conversion Robert B. Love 
2001-06-10 19:48     ` Jeff Creem [this message]
2001-06-10 22:10     ` Unchecked_Conversion Keith Thompson
2001-06-11 13:56     ` Unchecked_Conversion Ted Dennison
2001-06-11 14:21     ` Unchecked_Conversion Marin David Condic
2001-06-07 14:01 ` Unchecked_Conversion Jacob Sparre Andersen
2001-06-07 19:44 ` Unchecked_Conversion tmoran
2001-06-09 17:07   ` Unchecked_Conversion Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1992-01-02  6:09 unchecked conversion Robert I. Eachus
1991-12-31 13:53 Jean-Pierre Rosen
1991-12-30 23:25 Greg Lomow
replies disabled

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