Shop now Shop now Shop now  Up to 50% Off Fashion  Shop all Amazon Fashion Cloud Drive Photos Shop now Learn More Shop now Shop now Shop Fire Shop Kindle Listen in Prime Shop now
Customer Review

7 of 7 people found the following review helpful
4.0 out of 5 stars wide-ranging in scope, but heavy on C++ templates, 2 Mar. 2007
This review is from: Generative Programming: Methods, Tools, and Applications: Methods, Techniques and Applications (Paperback)
This book does cover lots of techniques that fall under the rubric of generative programming, but be warned that there is a strong emphasis on C++ template metaprogramming. If you don't know C++, or are a bit fuzzy on template syntax, you'll be missing a lot. Consider this a C++ template metaprogramming book, with some bonus chapters to put it all in context.

The opening chapters are a bit dull, containing a plethora of acronyms and jargon about various design methodologies, none of which seem to have made any particular impact in the last few years. I tentatively diagnose a mixture of thesis-itis and maybe translation-itis. If it's the former, I wouldn't be surprised to find that this made up part of the introduction or literature review chapter. However, the concept of feature diagrams is quite interesting, as it allows a graphical representation of a design specifying features and other properties (such as whether they're optional), without requiring any implementation (e.g. inheritance or parametric polymorphism), which is not possible with UML. How revelatory this is may depend on how seriously you take UML as a modelling tool, versus a convenient set of boxes and lines for representing class design.

There are also chapters on Aspect Oriented Programming, which is a pretty good survey of the field, and which provides useful motivation beyond logging. Additionally, there's a chapter on generators, which provide a convenient Domain Specific Language for specifying behaviour and performance of software components (list containers is the example in the book).

There's also a rather vacuous chapter on intentional programming, the brainchild of Charles Simonyi. It's an interesting enough idea, sitting somewhere between MDA, the Smalltalk class browser, and a souped-up IDE, but there's been absolutely no progress on it since the book was published, because Microsoft didn't release it, and Simonyi wasn't allowed to take any of the code with him when he left to set up Intentional Software. This chapter is ok on the big idea, albeit a bit breathless given it's not been shown to produce any useful software, but the worked example has all the allure of an Eclipse plugin tutorial.

The above material is sporadically interesting, but often a little pedestrian. However, the real action of the book takes place in the chapters on template metaprogramming in C++, which demonstrates how to generate related families of classes at compile time, using template instantiation and careful use of inlining to avoid inefficient virtual calls and indirection. It's very impressive. There are several examples, including a class hierarchy for a banking domain, and an in depth treatment of a matrix library, which successfully unifies all the types (sparse, full, banded etc.) under one library, while maintaining performance competitive with Fortran.

These C++ chapters demonstrate the ideas of the book in practice most clearly, although it also underlines the need for new tools and language features, given the outrageous ugliness of the compiler/template-abuse that is metaprogramming. On the other other hand, it is kind of cool to see colons, angle brackets and other bits of C++ coalesce into a strange new dialect using the compiler as an interpreter. If you're going to get anything at all out of these chapters, you do need to be comfortable with C++ templates. It would probably also help to have read something like Barton and Nackman's book, 'Scientific and Engineering C++', their unorthodox template designs providing a good warm up for what's in this book.

If you don't program in C++, or don't care for template metaprogramming, you may not find huge value for money in the other chapters. And admittedly, the writing style hardly sets the pulse racing. But if you're looking to do some intellectual stretching before taking on Andrei Alexandrescu's Modern C++ Design (and that's probably a very good idea), step right up!
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Be the first person to comment on this review.

[Add comment]
Post a comment
To insert a product link use the format: [[ASIN:ASIN product-title]] (What's this?)
Amazon will display this name with all your submissions, including reviews and discussion posts. (Learn more)
This badge will be assigned to you and will appear along with your name.
There was an error. Please try again.
Please see the full guidelines ">here.

Official Comment

As a representative of this product you can post one Official Comment on this review. It will appear immediately below the review wherever it is displayed.   Learn more
The following name and badge will be shown with this comment:
 (edit name)
After clicking on the Post button you will be asked to create your public name, which will be shown with all your contributions.

Is this your product?

If you are the author, artist, manufacturer or an official representative of this product, you can post an Official Comment on this review. It will appear immediately below the review wherever it is displayed.  Learn more
Otherwise, you can still post a regular comment on this review.

Is this your product?

If you are the author, artist, manufacturer or an official representative of this product, you can post an Official Comment on this review. It will appear immediately below the review wherever it is displayed.   Learn more
System timed out

We were unable to verify whether you represent the product. Please try again later, or retry now. Otherwise you can post a regular comment.

Since you previously posted an Official Comment, this comment will appear in the comment section below. You also have the option to edit your Official Comment.   Learn more
The maximum number of Official Comments have been posted. This comment will appear in the comment section below.   Learn more
Prompts for sign-in