comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin D. Condic" <mcondic-nospam@acm.org>
Subject: Re: conditional compilation
Date: 2000/07/31
Date: 2000-08-01T00:31:09+00:00	[thread overview]
Message-ID: <39861A49.7793D69C@acm.org> (raw)
In-Reply-To: 3985FB16.82D140BB@below.for.email.address

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
======================================================================




  reply	other threads:[~2000-07-31  0:00 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-31  0:00 conditional compilation Matthew Woodcraft
2000-07-31  0:00 ` Marin D. Condic
2000-07-31  0:00   ` Ira D. Baxter
2000-08-01  0:00   ` Simon Brady
2000-07-31  0:00     ` Marin D. Condic [this message]
2000-08-01  0:00     ` Ted Dennison
2000-08-01  0:00       ` Robert A Duff
2000-08-01  0:00         ` Laurent Guerby
2000-08-02  0:00       ` Simon Brady
2000-08-02  0:00         ` Simon Brady
2000-08-01  0:00           ` William J. Thomas
2000-08-02  0:00         ` Robert A Duff
2000-08-02  0:00           ` Brian Rogoff
2000-08-03  0:00             ` Robert A Duff
2000-08-02  0:00           ` Georg Bauhaus
2000-08-03  0:00             ` Robert A Duff
2000-08-03  0:00           ` Florian Weimer
2000-08-02  0:00         ` Georg Bauhaus
  -- strict thread matches above, loose matches on Subject: below --
2000-09-19  0:00 Conditional Compilation Kenneth Kueny
2000-09-19  0:00 ` Richard Riehle
2000-09-19  0:00 ` David Starner
2000-09-19  0:00 ` E. Robert Tisdale
2000-09-19  0:00   ` Larry Kilgallen
2000-09-19  0:00     ` Jeff Allen
2000-09-20  0:49       ` Robert Dewar
2000-09-19  0:00         ` Bobby D. Bryant
2000-09-24  0:00           ` Robert Dewar
2000-09-19  0:00   ` David Starner
2000-09-20  0:52     ` Robert Dewar
2000-09-20  0:47   ` Robert Dewar
2000-10-09  0:00   ` John McCabe
2000-09-19  0:00 ` Jeffrey Carter
2000-09-19  0:00   ` Samuel T. Harris
2000-09-20  0:44     ` Robert Dewar
2000-09-19  0:00 ` Ted Dennison
2000-09-20  1:33 ` tmoran
     [not found]   ` <8qauu3$7ei$1@nnrp1.deja.com>
2000-09-24  0:00     ` Robert Dewar
2000-09-25  2:45       ` Ted Dennison
2000-09-25  0:00         ` peter
     [not found] ` <39CA31F2.E160F0D8@res.raytheon.com>
2000-09-24  0:00   ` Robert Dewar
2001-01-02 13:27 ` Andrew Hately
2001-01-02 16:46   ` Robert Dewar
1989-12-12  0:08 conditional compilation Emery
1988-06-13  0:24 Conditional compilation Steinar Haug
1988-06-17 13:53 ` rds
1988-06-22  0:44   ` Jeff Bartlett
1988-06-23 13:01   ` Arny B. Engelson
1988-06-27 18:01     ` Dave Seward
1988-06-29 13:32   ` brucej
1988-06-17 14:48 ` rjs
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox