Boost logo

Boost :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-05-03 12:38:58


"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...

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.

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.

Regards,
Arkadiy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk