Boost logo

Boost :

From: Iain K. Hanson (iain.hanson_at_[hidden])
Date: 2005-05-04 07:59:27

On Tue, 2005-05-03 at 13:38 -0400, Arkadiy Vertleyb wrote:
> "Iain K. Hanson" <iain.hanson_at_[hidden]> wrote
> > Design and Evolution of C++ by Bjarne Stroustrup.
> >
> > >From the end of chapter 18 "The C Preprocessor " ( last Para ) :
> >
> > "I'd like to see Cpp abolished. However, the only realistic and
> > responsible way of doing that is first to make it redundant, then
> > encourage people to use the better alternatives, and <em> then </em> -
> > years later - banish Cpp into the program development with the other
> > extra-linguistic tools where it belongs."
> With all due respect -- this was written more than 11 years ago -- you
> cannot literally apply this now...

Why not? The arguments that the chapter uses are as valid today as when
> Regarding preprocessor -- this is the only built-in code generator in C++,
> except template metaprogramming, which is limited in this regard. And code
> generation is crucial for library writers. You don't use preprocessor --
> you end up with external tools, like MFC wizards or IDL compiler. I
> strongly prefer macros.

The preprocessor is NOT a code generator IMHO. It is a textual
substitution processor. In some ways I regard external tools as more
honest as they do not pretend to be C++ source code.

> Basically the question is: if you don't use the preprocessor, can you
> achieve the same without it (external tools don't count) and without
> violating the DRY principle? If yes, you probably better of without it. If
> no -- I don't understand the reason to reject macros.

IMHO external tools that do text substitution are equivilent to the Cpp
and do count. If you are after Good ( TM ) code generation tools then I
would go for graphical case tools that understand the language and type



This email has been scanned for all known viruses by the MessageLabs Email
Security System.

Boost list run by bdawes at, gregod at, cpdaniel at, john at