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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,43bc631fb4a56c2a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-10 12:48:02 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!chnws02.mediaone.net!chnws06.ne.mediaone.net!24.128.8.70!typhoon.ne.mediaone.net.POSTED!not-for-mail From: "Jeff Creem" Newsgroups: comp.lang.ada References: <9fnbtt$ild$1@e3k.asi.ansaldo.it> <41F37C284A6DE8C0.8A6A99719FF11B52.8149DC60E20677C9@lp.airnews.net> Subject: Re: Unchecked_Conversion X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Sun, 10 Jun 2001 19:48:01 GMT NNTP-Posting-Host: 24.147.117.96 X-Complaints-To: abuse@mediaone.net X-Trace: typhoon.ne.mediaone.net 992202481 24.147.117.96 (Sun, 10 Jun 2001 15:48:01 EDT) NNTP-Posting-Date: Sun, 10 Jun 2001 15:48:01 EDT Organization: Road Runner Xref: archiver1.google.com comp.lang.ada:8520 Date: 2001-06-10T19:48:01+00:00 List-Id: "Robert B. Love " wrote in message news:41F37C284A6DE8C0.8A6A99719FF11B52.8149DC60E20677C9@lp.airnews.net... > In 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...