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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b19fa62fdce575f9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-09 04:49:35 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!Germany.EU.net!news.dfn.de!gina.zfn.uni-bremen.de!marvin.pc-labor.uni-bremen.de!news.uni-stuttgart.de!iris1.csv.ica.uni-stuttgart.de!ucaa2385 From: ucaa2385@iris1.csv.ica.uni-stuttgart.de (Peter Hermann) Newsgroups: comp.lang.ada Subject: Re: Why don't large companies use Ada? Date: 9 Dec 1994 10:27:00 GMT Organization: Comp.Center (RUS), U of Stuttgart, FRG Message-ID: <3c9bdk$va5@info4.rus.uni-stuttgart.de> References: <3bj07h$qus@felix.seas.gwu.edu> <3blc1s$8gr@network.ucsd.edu> <3btf4n$jma@felix.seas.gwu.edu> <1994Dec8.092743.1@rapnet.sanders.lockheed.com> NNTP-Posting-Host: iris1.csv.ica.uni-stuttgart.de Date: 1994-12-09T10:27:00+00:00 List-Id: gamache@rapnet.sanders.lockheed.com wrote: [snip] : is particularly noticable when people use _type on type definitions. : Then you frequently see: : Mass : Mass_Type; this is very useful to identify an identifier as a type. : Few such simple issues get to me as much. : I even wish compilers would disallow : this construct altogther. disagree : What would a future reader like to : know? Is mass in kilograms, grams, milligrams? : Is length feet, meters, miles? : Code could then look like: : Obj1_Mass : Grams := 0.001; : which conveys much different information than: : Obj2_Mass : Kilograms := 0.001; : IMO, the distinction between this and the above is important. : Unfortunately, : too much code that I see uses types such as length, mass etc. : [ok, climb down from soapbox...] You are intermingling two different things: One is the typing of variables, the other is the accompanying (physical) dimension of the type. Ada did not go that far to attach dimensions to the type. But you can, as we discussed a couple of weeks ago, enforce those extras by means of programed extra mechanisms such as private types (example ref: "Ada in Action" by Do-While Jones) thereby enforcing the problem abstraction in the following way: example: area := length * length ; -- "*" allowed leng := length * length ; -- "*" not allowed! : ------------------------------------------------------------------------------- : Joe Gamache : Lockheed Sanders Inc. : with all_disclaimers_standard_or_otherwise; : _______ ______ / | | / ___ / : | | | ___| / \ |\ /| / \ | \ / \ : -- -- | | / / \ | \ / | / / \ | |\ \ / / \ : | | | -- / / \ \ | \ | / / \ \ | | \ | / / \ \ : | | | -- | --- | | \ / | | --- | | | / / | --- | : | | | | | --- | | |\| | | --- | | |/ / | --- | : | | | ---| | | | | | | | | | | | | | / | | | | : |_| |____| |_| |_| |_| |_| |_| |_| |_/ |_| |_| 2 objections: -- a friendly Ada Teamer would not waste bandwidth -- it's Ada (not ADA ;-):wq -- Peter Hermann Tel:+49-711-685-3611 Fax:3758 ph@csv.ica.uni-stuttgart.de Pfaffenwaldring 27, 70569 Stuttgart Uni Computeranwendungen Team Ada: "C'mon people let the world begin" (Paul McCartney)