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: 109fba,ef0074ec236ba6e3 X-Google-Attributes: gid109fba,public X-Google-Thread: 1108a1,ef0074ec236ba6e3 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,b19fa62fdce575f9 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,ef0074ec236ba6e3 X-Google-Attributes: gid1014db,public X-Google-Thread: 108717,ef0074ec236ba6e3 X-Google-Attributes: gid108717,public X-Google-ArrivalTime: 1994-12-09 04:49:20 PST Path: bga.com!news.sprintlink.net!pipex!warwick!not-for-mail From: csusb@csv.warwick.ac.uk (Jules) Newsgroups: comp.lang.ada,comp.lang.c,comp.programming,comp.lang.c++,comp.object Subject: Re: Why don't large companies use Ada? Date: 9 Dec 1994 12:47:42 -0000 Organization: University of Warwick, Coventry, UK Message-ID: <3c9jle$796@thyme.csv.warwick.ac.uk> References: <1994Nov29.154220.27952@cognos.com> <3blinp$8dm@gnat.cs.nyu.edu> <3c873t$lut@calvin.st-and.ac.uk> NNTP-Posting-Host: thyme.csv.warwick.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Xref: bga.com comp.lang.ada:8450 comp.lang.c:34021 comp.programming:5737 comp.lang.c++:40285 comp.object:9642 Date: 1994-12-09T12:47:42+00:00 List-Id: In article <3c873t$lut@calvin.st-and.ac.uk>, ajry@st-andrews.ac.uk (Alistair James Robert Young) writes: >In article , >James Kanze US/ESC 60/3/141 #40763 wrote: >> >>I might also point out that used correctly, C++ has relatively strict >>type checking. (When discussing languages, it is important to know >>what is being compared to what. In most of my work, the alternative >>to C++ is C, so I have become somewhat of a C++ fan.) >>-- > >I'd agree that strict type-checking is a good thing, in that it can prevent >the many nasty errors that result from getting it wrong manually. However, >in some cases, it can be a nuisance. To quote a specific example, I am >in the throes of learning C++ m'self, and have a problem using the OS-specific >header files with C++. > >These header files use a type PSZ to pass strings to functions. This type >(pointer to string terminated by zero) is exactly the same as a char *, >but the compiler refuses to acknowledge this, forcing me to use three or >four typecasts in every OS call. > >Strict type-checking's all very well, but you need to be able to turn it off >for specific cases. BTW, if anyone knows a way to do this for PSZ/char *, I'd >really appreciate it! This is one of the problems of adding strict typing onto the top of an existing language, as was done for C++. Basically, the problem is the 'PSZ' type should either be used in all cases, or not at all. It's a good idea to have the separate type (in some cases you may also be using Pascal style strings, which would have a different type [probably 'PST', following the hungarian convention], also defined as being a char *, thus preventing you from mixing the two types up), but the HUGE problem is the large number of C libraries that use 'char *' for all strings, thus requiring type-casting between the types. What you need is a new language, rather than an extension of an existing one, which forces all users to completely rewrite their libraries to be more compatible, rather than mindlessly attempting to write patch after patch to interface their C++ code with existing C libraries. Enter Ada... -- /* Julian R Hall csusb@csv.warwick.ac.uk Flames should be redirected to /dev/null - I don't know what I'm saying myself so don't expect it to make sense all the time! */