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,c7ea1cb7a2beb2ee X-Google-Attributes: gid103376,public From: Charles Hixson Subject: Re: Disallowing Pre-Defined Operations Date: 2000/03/20 Message-ID: <38D6541E.D2D654AB@earthlink.net>#1/1 X-Deja-AN: 599991323 Content-Transfer-Encoding: 7bit References: <8a9eeg$qtv$1@newpoisson.nosc.mil> <8ababr$c3u$1@wanadoo.fr><8afhed$f9v$1@newpoisson.nosc.mil> <8aoifb$49f$1@newpoisson.nosc.mil> <38D001D7.4D6E4284@averstar.com> <38D013EF.1F431E34@cadence.com> <38D15537.B06CA311@earthlink.net> <38D2A073.A30FF041@cadence.com> <38D2ACA9.84FBD9F6@earthlink.net> <8b0p33$afd$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 953570352 198.94.156.19 (Mon, 20 Mar 2000 08:39:12 PST) Organization: EarthLink Inc. -- http://www.EarthLink.net MIME-Version: 1.0 NNTP-Posting-Date: Mon, 20 Mar 2000 08:39:12 PST Newsgroups: comp.lang.ada Date: 2000-03-20T00:00:00+00:00 List-Id: My understanding was that there were separate modules coded correctly internally, that were operating on the basis of different units, and that the problem probably occurred where the two modules communicated, that their hand-shaking didn't identify the unit in use (each assuming that its own unit was, of course, the one to calculate with), so what was passed was an untyped numeric. Thus the problem was that using units is a LOT of work in just about every environment, so people tend to avoid it, when it seems "obviously unnecessary". A system that allows units to be specified easily and inter-converted automatically would be both save and easy. That's what units were designed for. Kilometers can convert to feet, but not to pounds, etc. Both, however, look just like numbers if you strip off their units. And also kilometers look just like meters. I'm currently working on an application that displays dollars rounded off to thousands. Because of the problem of keeping the units straight I am actually maintaining a count in cents right up to the display step, and then dividing in the display. This keeps me from mixing up the units (the application is in VB, so you can guess how easy THAT would be), but it does keep me from even THINKING about such refinements as bucket rounding. I.e., it's nearly adequate for this job, but v. far from ideal. OTOH, screen painting and report formatting in VB (MSAccess, actually) is *!*SO*!* much easier than in Ada. OTOH, I am operating off of memories of NASA public reports, I didn't go digging. I could have the details wrong for this time. That wouldn't convince me that the general principle was wrong (but then nearly all of my work has been in a language other than Ada...perhaps Ada types are already strong enough to easily handle the problem). Robert Dewar wrote: > In article <38D2ACA9.84FBD9F6@earthlink.net>, > Charles Hixson wrote: > > > > That would have saved at least one space probe. (By that here > > I mean the automatic conversion of units.) > > If you are talking about the Mars probe, that is unconvincing. > As you know if you have read the details, the issue was simply > that the value was entered in the wrong units. No feature in > a language could have prevented this. If the programmer had > been alert enough to worry about this happening and use some > kind of typed units aware input, then the entire problem would > not have occured, after all a sufficient fix here would simply > have been to make it super-clear what units were expected. > > Sent via Deja.com http://www.deja.com/ > Before you buy.