Penguin Power!
Buy Linux distributions at discount prices!
Linux| Perl| PHP| Webserv| Databases| Sysadmin| Programming| Filesystems| Java| Webprog
News from Slashdot
Iran Reverse Engineers Cobra Attack Helicopter

Ask Slashdot: How To Shop For a Laptop?

Cisco All But Kills Cius Tablet

Germany Sets New Solar Power Record

Certain 'Personality Genes' Correlate With Longevity, Says Study

US CIO/CTO: Idea of Hiring COBOL Coders Laughable

Barter-Based School Catching On Globally

Can You Buy Tech With a Clean Conscience?

Van Jacobson Denies Averting Internet Meltdown In 1980s

19-Year-Old Squatted At AOL For 2 Months


Related products:





C

Modern C++ Design: Generic Programming and Design Patterns Applied

C
Format: Paperback
Author: Andrei Alexandrescu
ReleaseDate: 13 February, 2001
Publisher: Addison-Wesley Professional
Rating:

Useful only as an idea guide for what is possible with C++ template metaprogramming


Most template meta-programs are candidates for programming obfuscation contests, and when you get into programming in the large, the situation is aggravated. With about 13 years of C++ programming and 8 years of standard C before that I can say that this book, while useful as an idea guide for what is possible with C++ template metaprogramming, I would recommend against utilizing these techniques in production code.

For instance, one example in the book is an elaborate class-registration/class-factory scheme implemented with a template metaprogram. Consider as an alternative the class-registration and factory in the Metrowerks PowerPlant class library. PowerPlant, which is extraordinarily well designed, achieves the same functionality with a single template function (no metaprogramming required) in conjunction with the rigor of exposing a single public constructor (function signature 'pattern') in each class you wish to register with 'the registrar'.

Template programs are notorious for their tendency to tie your code to a single compiler/vendor (see the Boost. org compatibility chart). My advice, use templates judiciously and when the problem can only otherwise be expressed using the macro preprocessor.

The best book on template programming has a black cover and is about 2" thick (softcover). It's called "Generative Programming: Methods, Tools and Applications" by Krzysztof Czarnecki et al. (ISBN: 0201309777). This book will mold your thinking into new ways of architecting large software systems using features of C++, including templates, in novel ways that actually reduce complexity, make more maintainable code and utilize templates in novel and thought-provoking ways.

I refactored a complex software project making extensive use of C++ templates, and I employed techniques from Generative Programming. I used none of the techniques from Modern C++ Design.

If you are a manager and your technical team wants to use the techniques from Modern C++ Design, make sure they sign on for at least 5 years of maintainance and all the bug fixes. That oughta sober them up a bit. The techniques illustrated in this book are essentially unmaintainable with the current generation of C++ compilers and the error messages they emit.

Templates were designed to replace the #define preprocessor techniques that were nearly impossible to understand and maintain. If your template code is harder to maintain than your most elaborate #define code, then I say you're moving in the wrong direction.


Changed my perspective on template metaprogramming
I am ashamed to confess that I hadn't before, because I heard so many reviews of it along the lines of "mind-blowing, but useless". I am finally working my way through Andrei's book.

Those reviews are dead wrong. It's a pleasure reading it, and the techniques are eye-opening. Most template articles and books I find to be completely impenetrable. I'm amazed and pleased how easy this one is to read and understand. I think the author has a gift for writing. Scott Meyers' assessment of it in the forward is dead right. Not many books change my perception of things, but this has.
.


For C++ lovers
Not practical for your everyday projects; still get one and read it!. Worthy theoretical reading on what C++ language is capable of and is a surprize even after years you've programmed in it.



Go to lyrics-now.com for music lyrics and song lyrics.
Bass and guitar tablatures: Fretplay.com, Guitar tabs, Bass tabs, Fresh tabs, How to read tabs
Plan your travel and holiday here: Travel Helper!