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-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail From: "Jerry Coffin" Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: 23 Mar 2005 15:12:48 -0800 Organization: http://groups.google.com Message-ID: <1111619568.938415.90010@g14g2000cwa.googlegroups.com> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1111607633.301232.62490@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: 165.236.235.120 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1111619573 15536 127.0.0.1 (23 Mar 2005 23:12:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 23 Mar 2005 23:12:53 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=165.236.235.120; posting-account=mZiOqwwAAAC5YZsJDHJLeReHGPXV5ENp Xref: g2news1.google.com comp.lang.ada:9845 comp.lang.c++:46934 comp.realtime:1642 comp.software-eng:5246 Date: 2005-03-23T15:12:48-08:00 List-Id: Larry Kilgallen wrote: > In article <1111607633.301232.62490@z14g2000cwz.googlegroups.com>, "Jerry Coffin" writes: > > > Some of the cited cases provide checks that are free in terms of > > run-time, but run-time is hardly the major cost in most software. > > Really ? > > Even programs I write for my own personal use are run _many_ more > times than they are compiled. Personally, I often spend compile > time thinking some more about the problem, sometimes to good > advantage :-) Being compiled isn't the major cost either. For an awful lot of software, being run multitudes of times doesn't make speed important -- interactive software (for one example) has something on the order of really soft real-time requirements. I.e. too slow is mildly annoying, but any response time under 100 ms or so qualifies as "instant", and after that making it 100 or even a million times faster rarely accomplishes much. > > Just for one obvious example, Ada doesn't provide an easy way to > > express/do most of the things one can do with the C or C++ > > preprocessor. > > It does not provide a preprocessor, for safety reasons. Look again at the wording -- I spoke in terms of the capabilities that C happens to provide as what's generally called the preprocessor. I could say "phases 1 through 6 of translation" if I wanted to be more formal, but it's utterly irrelevant. Regardless of the wording, however, I think this is (mostly) a red-herring. What do you consider unsafe about (for example) some chunk of code being compiled only when I want it to be? If I really believe in the compiler's optimizer, I can already do things like "if False" in Ada, and that code clearly won't ever execute. It just happens that C and C++ provide a simple and practical method of doing the same things in a way that's easy to externally control. > But what programming step (as distinguished from construction trick) > can only be performed from a preprocessor ? Attempting to separate programming from constructing (a program) seems to me a strong indication that you don't really know much of what you're talking about. Regardless of this, however, the fact is that even in Ada people who have a preprocessor available (e.g. with GNAT) frequently find it extremely useful -- but using it renders the code completely non-portable. > > Some areas are somewhat more questionable -- calling a class a > > "tagged record" is clearly a mistake, but it's open to question > > whether it should be classified under poor expression of the > > concept, or just general idiocy. > > I see no mistake. There is none so blind as he who will not see. The biggest problem is that "tagged record" is a low-level description -- i.e. it's about the implementation, not the real concept. A secondary problem is that in other Pascal-family languages (e.g. Pascal, Modula II, Modula 3 and probably Oberon), a "tag" is the distinguishing characteristics of a variant record, having nothing to do with object orientation. > Is it possible your background in Pascal is inadequate > and overwhelmed by your background in C* languages. Pascal has records, but not "tagged records". I don't believe Modula II, Modula 3 or Oberon uses such poor terminology either. I don't see how background in C signifies at all, since it doesn't use "record", "tagged record" or "class" at all. I suppose one could point out that C uses names that reasonably accurately reflect what's being discussed, but I have a hard time calling that a bad thing... OTOH, if you look through a language-neutral book on object oriented programming, you'll "class" used to name a rather general concept quite routinely. By contrast, I've yet to see "tagged record" used to describe anything except the syntax of Ada 95. -- Later, Jerry. The universe is a figment of its own imagination.