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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd63afa4dc364b7e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-26 19:34:02 PST Path: supernews.google.com!sn-xit-03!supernews.com!hermes2.visi.com!news-out.visi.com!news-out.visi.com!hermes.visi.com!pulsar.dimensional.com!dimensional.com!newsfeed.frii.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.onemain.com!feed1.onemain.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail From: "Phaedrus" Newsgroups: comp.lang.ada References: <98m938$2iod0$1@ID-25716.news.dfncis.de> <99alrr$itf$1@nh.pace.co.uk> <99d5dj$fi4$1@nh.pace.co.uk> <99nkte$157$1@nh.pace.co.uk> <3AC002AA.73118A89@votehere.net> Subject: Re: Implementing C/C++ style #include... X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: <1NTv6.16219$ue1.1372775@newsread2.prod.itd.earthlink.net> Date: Tue, 27 Mar 2001 03:27:57 GMT NNTP-Posting-Host: 209.178.103.28 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 985663677 209.178.103.28 (Mon, 26 Mar 2001 19:27:57 PST) NNTP-Posting-Date: Mon, 26 Mar 2001 19:27:57 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: supernews.google.com comp.lang.ada:6098 Date: 2001-03-27T03:27:57+00:00 List-Id: Funny, I thought that C++ was the "worst form of evil imaginable". No, scratch that... Our software management is the worst form of evil imaginable, C++ is just number two. Or maybe three, after taxes. But it's a close race. Pestilence? Isn't that the same thing as C++? Phaedrus "Andrew Berg" wrote in message news:3AC002AA.73118A89@votehere.net... > > Robert A Duff wrote: > > > > Pascal Obry writes: > > > > > I agree with you that in such a case a preprocessor could be usefull. Anothe > > > way to handle this is by writing a template and have the right spec generated > > > by a script. > > > > > > function Ada_Size_Of_Input is new > > > Interfaces_C_More.Storage_Unit_Size_Of (Input_Type); > > > pragma Export (, Ada_Size_Of_Input, > > > "ball_ct633_ada_size_of_input", > > > "ball_ct633_ada_size_of_input"); > > > > Your "script" is, in fact, a macro preprocessor. > > > > Are macros more or less evil than #if things? > > I've heard both opinions in this thread. ;-) > > As a full time C++ programmer, I'm going to have to side with Pascal > here. Textual macros are dangerous, but a limited form of dangerous. > > #if's on the other hand are quite possibly the worst form of evil > imaginable, in that it is never really possible to know exactly what is > going on. Even in simple cases it is bad, because when maintenance > happens they always get worse. I suppose that if you are writing code > that will never get looked at they might not be so bad, but I have never > had that luxury. > > Probably the only decent application of #if is '#if 0' as a way to > comment out multiple lines of code at once. C's /* */ comments cannot > be nested and it gets really tedious to put //'s everywhere, so #if 0 is > a useful construct. > > If you want an example of the kind of hell I am thinking of, go download > 'stlport', a reasonably portable, reasonably compliant version of C++'s > STL. Look at those header files for a while... > > -andrew >