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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f34f1a1939dc0c40 X-Google-Attributes: gid103376,public From: "Marin D. Condic" Subject: Re: conditional compilation Date: 2000/07/31 Message-ID: <39861A49.7793D69C@acm.org>#1/1 X-Deja-AN: 653018538 Content-Transfer-Encoding: 7bit References: <87d7jvp3qq.fsf@chiark.greenend.org.uk> <39857E5F.33C40014@acm.com> <3985FB16.82D140BB@below.for.email.address> Organization: Quadrus Corporation X-Sender: "Marin D. Condic" (Unverified) X-Server-Date: 1 Aug 2000 00:31:09 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-08-01T00:31:09+00:00 List-Id: Simon Brady wrote: > > Maybe I'm being pedantic here, but I don't consider this an acceptable > substitute for "real" conditional compilation. Sure, with a good > compiler it achieves the results (debug support with zero runtime cost > in the production build), but from a maintenance perspective it strikes > me as a Bad Thing. > Said I had a use for it. Didn't say I actually liked it. :-) Pragma Debug is almost certainly a better way to go for debug code - unless you want to leave the debug code in place. (Good reasons to do that sometimes.) I've not often run into situations where I thought conditional compilation was essential to getting the job done. It may be useful, but may not be the best way to get there. I've used the "if" method when I've had to maintain a configuration that ran on a brassboard demo and another version that ran on the real hardware. Sometimes you've got hardware on one machine that doesn't exist on the other and its easier to maintain one flag that builds the software either way. In that case its a reasonably natural way of getting what you want because you'd probably be doing this kind of flow control with a runtime variable anyway. Of course it doesn't let you get rid of declarations that you don't need for a given build, so it is a weak substitute in that sense. I guess I don't really know what to think on this issue. Conditional compilation may be useful. So might "include" directives or macros or other features found in other languages. Still, it may not be in the spirit of The Ada Way and they may cause more problems than they fix. I guess I don't find any really compelling reasons to expand the language to include them. But I'm listening if you want to make a case.... MDC -- ====================================================================== Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/ Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m Visit my web site at: http://www.mcondic.com/ "Nothing in the world is more dangerous than sincere ignorance and conscientious stupidity." -- Martin Luther King, Jr ======================================================================