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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c6ca9cbe17b867c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!newsfeed.mathworks.com!nntp.abs.net!attws2!att542!ip.att.net!newsfeed3.global.lmco.com!svlnews.lmms.lmco.com!not-for-mail From: "Xenos" Newsgroups: comp.lang.ada Subject: Re: access & address Date: Thu, 14 Oct 2004 15:37:26 -0400 Organization: Hades Message-ID: References: <1c2f5137.0410140105.66fdb23e@posting.google.com> <1347924.5V7QhTSfdI@linux1.krischik.com> <2t7jm8F1sp752U1@uni-berlin.de> NNTP-Posting-Host: 158.187.64.144 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Xref: g2news1.google.com comp.lang.ada:5218 Date: 2004-10-14T15:37:26-04:00 List-Id: "Marc A. Criley" wrote in message news:2t7jm8F1sp752U1@uni-berlin.de... > "Xenos" wrote: > > > > "Martin Krischik" wrote in message > > news:1347924.5V7QhTSfdI@linux1.krischik.com... > > > Unlike C/C++ where you can't switch type safety on even when you > > desperately > > > need it. > > > > > You obviously know nothing about C++ then. > > Don't tell me I can write a class to make this check, no one writes classes > to keep track of item counts. And if I create a CApples class and a > COranges class that includes quantities and prevents me from mixing Apples > and Oranges, why is it that _I_ then have to code up the range checking, > when every Ada programmer would write: > > type Apple_Count is range 0 .. 500; > type Orange_Count is range 0 .. 120_000; > > and let the compiler do both type safety and range checking. > Your point was not that you disliked the way you "switched on" type safety in C++. You said you could not do it; you're point was incorrect. Don't make a statement, and when told you're wrong say, "oh, yeah you can do X, but I don't like X." Such does not maintain the veracity of your statement. Nothing prevents you from mixing Apples and Oranges, you just have to tell C++ how you want this accomplished. Plus, you can tell the compiler whether to allow an implicit conversion or not with the explicit keyword. Weren't you just arguing for type-safely? You say C++ is not type-safe, yet you complain you can't just mix apples and oranges. Yes, Ada has more type safety than C++, but saying is completely without any is just plain wrong (even C has *some*). Yes, its type-safety with numerical and (decayed) arrays could be better. Its safety with classes is very strong. Enumerations are close, except for allowing implicit conversion to int and not automatically range-checking. Even type-safety for pointer types is very strong, allowing only implicit conversions to void* and base-class pointer types (it is, of course, missing Ada's strong scoping rules for access types).