マルチパラダイムデザイン 単行本 – 2001/12
Kindle 端末は必要ありません。無料 Kindle アプリのいずれかをダウンロードすると、スマートフォン、タブレットPCで Kindle 本をお読みいただけます。
I got turned on to this book by a presentation at TechEd. According to the speaker, C# is capable of at least five different coding paradigms, only one of which is Object Oriented. In the enterprise development world, OO is viewed as the "right" way to do things, with no understanding of the tradeoffs being made by following the OO approach. Worse, object models are getting created by people that have no idea how to validate the design. What is "right" and "wrong" is decided mostly by gut feel. If you ever hear the phrase, "well, I had to do some refactoring in the classes that were inheriting from mine because the change I made broke some stuff," you know the design was bad.
When I review code, I see developers drifting in and out of the OO style, mixing in bits and pieces of Functional programming, a bit of event-driven/message-based programming, and absolutely no idea of why or how to decide which paradigm to follow in a given situation. Worse, if they know any theory at all, it's only for the OO approach. Not good when trying to use the Functional programming features in C#.
If you just thought to yourself that C# is only an OO language, then you REALLY need to read this book.
I found this book to be an excellent starting point for anyone trying to educate themselves on the appropriate use and selection of a programming paradigm. It has enough theory to get you started, and will build enough of a vocabulary to let you find more focused books.
The computer book market is flooded with how-to guides. This isn't one of them. As developers, we are pretty good at getting things done. However, that still leaves us a far cry from treating our profession as a craft, worthy of deep understanding. I suspect this may be part of the reason why 80% of software development costs occur after a product has gone to production, even in the corporate world.
Yes, this book can be hard. In fact, it can be very hard, especially for an experienced developer that is reading quickly while looking for the "how-to" bits. The book challenges you to go back to first princples, which is hardest for folks that have made a career of getting the job done and slinging code as needed. Read the book like a college text book, and it might help. Read each chapter twice. If you can get your head around it, it's worth the effort.
First off, where has this book been hiding? When I first read Coplien's Advanced C++ in 1992, it blew me away. I read and reread it like it was epic poetry (oh wait, that's because, well, it IS). Coplien is everything you want in an author: first, he is literate. Unlike junior who can only hold the book w/one hand (since they took away his pacifier, he has to use his thumb), he has clearly read and digested a LOT of stuff. Science people, too often have zero literary sensibility at all. Funny that the great scientists seemed to. Oppenheimer read in several languages and quoted the Baghavad Gita, Greek scholars, and was into poetry. Anyway, Coplien can also claim to have been, to borrow the Dean Acheson phrase 'Present at the Creation' (though, lucky for Cope, he was there and took part in the birthing of the most important software dev movement in the last 25 years, while Acheson helped cement the modern police state). Finally (on this front), this book is not only readable, it reads like the wind. And believe me, friends, I was almost suckered into believing the whiney tail of my hero's demise.
Now, here are a few more things I'd like to say about this book:
1. I have been reading a lot about PLE lately, and this book plugs into this so well, it's bizarre. For instance, this book takes some serious time to talk about how to do variability analysis, but also discusses things like the mapping of domain variability requirements to language features, the various codifying tools that enable substitution, but also substitution w/variation (e.g. parameterization, virtualization, etc.), but then, in a bonus turn on this vector, he talks about how this meshes with patterns, showing for instance how cases of negative variability (where the deriver wants to erase part of the base) can be refactored to Bridge, etc.
2. Don't get too thrown by the multi-paradigm angle the title implies: this book is not just a screed espousing the use of functional sideshoots, or procedural deviations.
In summary, this is a great book and I can't believe I did not know it existed until recently. If you are doing product oriented development especially, and variation at more than just the simplest level is a daily demand, this is one of the best wells to visit.
This book is not about C++ per se. It is about the design process for C++ programmer. The language choice of C++ is simply because C++ supports all the paradigms in question.
I would further comment that this book is quite hard to read. A quick browse possibly won't get you anywhere. There doesn't seem to be any logic behind the flow of the book. This is why I said that you have to know the material already to feel entertained by it.
However, the concept that the book talks about is very important that I think every good programmer should be aware of.
The other complaint I have is that if you've already read that much about C++, then you have to wade through a lot of stuff that you've already figured out just to dig up the dozen or so nuggets of new insight. (Admittedly, I'm prejudiced against dissecting methodology, so you might take this view with a grain of salt.)
This book isn't bad, but for the average C++ programmer there's probably a lot of fruit out there that hangs lower than this one. "Design Patterns" (Gamma), "The C++ Programming Language" (Stroustrup), "Exceptional C++" (Sutter) and "The C++ Standard Library" (Josuttis) come to mind.