Modern C++ Design"is an important book. Fundamentally, it demonstrates 'generic patterns' or 'pattern templates' as a powerful new way of creating extensible designs in C++-a new way to combine templates and patterns that you may never have dreamt was possible, but is. If your work involves C++ design and coding, you should read this book. Highly recommended." -Herb Sutter
"What's left to say about C++ that hasn't already been said? Plenty, it turns out." -From the Foreword by John Vlissides
In "Modern C++ Design, " Andrei Alexandrescu opens new vistas for C++ programmers. Displaying extraordinary creativity and programming virtuosity, Alexandrescu offers a cutting-edge approach to design that unites design patterns, generic programming, and C++, enabling programmers to achieve expressive, flexible, and highly reusable code.
This book introduces the concept of generic components-reusable design templates that produce boilerplate code for compiler consumption-all within C++. Generic components enable an easier and more seamless transition from design to application code, generate code that better expresses the original design intention, and support the reuse of design structures with minimal recoding.
The author describes the specific C++ techniques and features that are used in building generic components and goes on to implement industrial strength generic components for real-world applications. Recurring issues that C++ developers face in their day-to-day activity are discussed in depth and implemented in a generic way. These include:
Policy-based design for flexibility Partial template specialization Typelists-powerful type manipulation structures Patterns such as Visitor, Singleton, Command, and Factories Multi-method engines For each generic component, the book presents the fundamental problems and design options, and finally implements a generic solution.
In addition, an accompanying Web site, "http: //www.awl.com/cseng/titles/0-201-70431-5," makes the code implementations available for the generic components in the book and provides a free, downloadable C++ library, called Loki, created by the author. Loki provides out-of-the-box functionality for virtually any C++ project.
Get a value-added service! Try out all the examples from this book at www.codesaw.com. CodeSaw is a free online learning tool that allows you to experiment with live code from your book right in your browser. 0201704315B11102003
I don't know who the intended audience is. Don't read this if you think it's about templates, it's more about making templates do clever tricks for you. And by clever I mean cryptic, obfuscated and questionable in their usefulness in the real world. I kept on thinking that the next chapter would be more relevant to me, but three quarters of the way through just gave up. I see no relevance to my work and personal programming.
Книжка, в общем-то, читается вполне нормально даже спустя столько лет. Достаточно годная первая часть про Techniques. Первые три главы даже перечитал. Вторая часть местами ок, местами не очень. Читать про реализацию абстрактной фабрики можно из общего интереса, но как только появляются GenScatterHierarchy/GenLinearHierarchy сразу кажется, что что-то идёт не так. Как руководство к написанию production-кода стоит воспринимать с осторожностью, потому что кому-то это всё потом поддерживать.
Este libro es sencillamente alucinante, de principio a fin. Es un libro para admirar al autor por la librería increíble que construye, poco a poco, capítulo tras capítulo, usando unas técnicas que van mucho más allá de la programación en C++ que muchos estamos acostumbrados a ver, usando metaprogramación para crear, en unas pocas líneas código, diseños que serían mucho menos efectivos o prácticamente imposibles de mantener de ninguna otra manera.
Doblemente alucinante al pensar que el libro está publicado en el año 2000, antes incluso que el estándar anterior al actual, y que, 12 años, después, sigue teniendo este potencial de dejar al lector tremendamente inquieto.
La advertencia es clara: leer este libro te cambia como programador de C++, y para bien sin duda. Un libro que estoy seguro volveré a leer.
Great book, delving into the specifics of template meta programming (but not too deep, mind you). Although, you can find a lot of gems in it, beware - it is rather outdated, dealing with the ancient C++03! There are a few chapters a few chapters about making a list of types (yes, types!) with templates (they are really similar to LISP lists); one chapter about writing an allocator for small objects and a neat implementation of the visitor pattern. For me these alone are enough to read the book!
Brings back nostalgia. The techniques taught are as of now completely out of date, but the amount of creativity and ingenuity of Alexandrescu in implementing useful structures using esoteric meta-programming techniques are without match. Necessary read for anyone interested in the weird side of C++. Also try to stay up to date and avoid the monstrousities showcased here, but if your codebase is old and there are no alternatives, then this book might prove immensely useful!
Gives a lot of insights about the various aspects and tradeoffs pertaining to the implementation of generic design patterns in C++, as well as the motivation behind each pattern. Policy-based design, described and utilized abundantly in the book, is also a powerful design technique for building generic components. The book is a bit outdated though. For example, Typelists, the vehicle he uses to build many of his patterns, is no longer needed given the introduction of variadic templates in C++11.
Read it front to cover, now it's time to read it again -- so much good stuff!
Most of the development I've done last decade has been in C++, so I thought I'd seen it all. Couldn't have been further from the truth - wow; there's so much more to learn! Imagine all this was out there while I was using Boost (but never dared to look inside).
Alexandrescu is a great narrator, so even though he treats some deep and technical stuff he never loses his reader and frequently succeeds in making his tricks look trivially easy.
If it was for the fact that many of the topics covered in the book were so advanced that they are not applicable to day to day software development, I'd give the book 5 stars.
I was introduced to generic programming and Andrei's book at a presentation by Martin Fowler. I have to share Fowler's view that Alexandrescu is at a level beyond most of us. However, even though I don't find the book applicable to my day to day job, I do find it stimulating and revisit it from time to time.
Если вы знаете как работают механизмы обобщенного программирования в языке C++, но не знаете как их применить, то эта книга для вас. Не смотря на то, что с момента издания прошло уже больше десятилетия и некоторые техники описанные в книге утратили свою актуальность с выходом C++11, основные принципы обобщенного программирования остаются прежними, поэтому книга актуальна и по сей день. Главное относится к изложенным идеям прагматично.
Not the type of book you'd read w/out at least a few other C++ programming and software design books under your belt... Not to mention a couple years in the field to build up some experience. Still, if you've ever used the boost libraries, the first 4 chapters will really help you understand the design philosophies.
I was already quite proficient at C++, but using generics was still a bit of a mystery. This book helped me enormously in exploring what was possible. I remember how intellectually stimulating this book was, hence the five-star rating.
Haven't used this since 2005 I guess, when work switched to Java.
I know this is an important book, usually mentioned as one of the books you must read for c++, but I think is intended for library developers. I you are a plain application developer this is too much. It would be nice to understand the tecniques, even if you are never going to use them, but I still think is not worth the effort.
While some of his concepts are now a little outdated with C++11 (in the sense that it can now be implemented much easier) this is still a great book the shows the power and possibilities of C++ template meta-programming.
As Scott Meyers once wrote that C++ is a confederation of 4 languages - C, Object-oriented C++, Templates and the STL. This book is a must read to understand the template language of the confederation - if you want to write type-safe, minimum duplication code.
Needs great understanding of template machinary, but this is one of C++ In-Depth Series, and this book is nailing it. Provides neat and modern implementations for some GoF patterns in C++. I'd also like to see some C++11 additions or modifications for the implementations too.
Must read для advanced плюсовика. Хоча з поширенням boost і виходом C++11 інформація в книжці трохи застаріла, але описані методики ще працюють, біль того, частина них стала частиною тих самих boost та C++11
Rather than direct application, what I learned from this book was how to think creatively while being bound by your tools. Alexandrescu is thoughtful, funny and very engaging. He starts off simple and builds a (sometimes messy) fortress. Overall a very fun and interesting book.
Advanced book .. initially when i tried to read in coll days i had tough time understanding. If you are really experienced programmer you can understand easily.
Some interesting thoughts on the mechanics of templates and using templates for policies, but the specific class implementations in the last two-thirds of the book are dated and not really worth it.