Domain: cgocable.net
Stories and comments across the archive that link to cgocable.net.
Stories · 17
-
Refactoring: Improving the Design of Existing Code
SEGV has returned and is continuing his excellent set of reviews. This time around, we're looking at Martin Fowler's (with Kent Beck, John Brant, William Opdyke, and Don Roberts) Refactoring: Improving the Design of Existing Code. Click below for more details. Refactoring: Improving the Design of Existing Code author Martin Fowler with Kent Beck, John Brant, William Opdyke, pages 431 publisher Addison-Wesley rating 9/10 reviewer SEGV ISBN summary Just what the working programmer ordered: a catalogue of practical refactorings with solid advice on when and how to apply them.Overview
This book could very well do for refactoring what the "Gang of Four" book did for design patterns. In fact, with the number of contributing authors, this might well become known as the "Gang of Five" book. (They contributed content to chapters 3 and 12 through 15.)
Organization
Refactoring leaps in feet first with an extended example. I found this to be a surprisingly effective opener: it didn't overwhelm me, and left me hungry for more. The first chapter follows a sample program through several incremental refactorings, and the reader gets the idea via osmosis.
To illustrate the technique of refactoring, the first chapter presents the original code on the left page, and the resulting code on the right, with changes in bold. This presentation, coupled with explanatory text, makes it easy to see what's going on and focus on what's happening. It's as if you're looking over the author's shoulder as he edits, compiles, and tests code in his development environment.
What is Refactoring?
Now that you've done a refactoring, you might be curious to know more about what refactoring is. The next few chapters provide the relevant background.
Refactoring is what the book's subtitle suggests: changing code in in ways that preserve behaviour, but improve the way that behaviour is generated. This could be as trivial as renaming a method, or as tricky as separating domain and presentation classes.
Why go through this trouble? In the end, the code is different but it acts the same; there has been no new functionality added. Why? You do this to place yourself in a better position to add new functionality to the software. If you don't, you eventually end up with spaghetti code that is unmaintainable and will not support new functionality at all.
I think anyone who has worked on real code can appreciate the need for refactoring. In fact, most good programmers already do it, although perhaps only on a subconscious level. What this book aims to do is to raise that ad-hoc activity to a higher level of applied technique. Just as there are principles and practices in GUI design (as opposed to merely throwing widgets together randomly), there are principles and practices in refactoring activity: this book catalogues them.
Catalogue
Sandwiched between introductory and summary chapters is the meat of the book: a catalogue of over seventy refactorings. This catalogue follows in the footsteps of the highly successful Design Patterns format: Pattern Name and Classification, Intent, Also Known As, Motivation, Applicability, Structure, Participants, Collaborations, Implementation, Sample Code, Known Uses, and Related Patterns. Since the individual refactorings are less complex than patterns, this catalogue uses the format: Name, Summary, Motivation, Mechanics, and Examples.
The idea is the same. The name and summary provide a definitive vocabulary and a reference-card example. The motivation explains the relevance of the refactoring. The mechanics cover the step-by-step details of how the refactoring is executed. Then a series of examples demonstrate the variations.
Applicability
I like the catalogue. Although some refactorings seem deceptively trivial, it is useful to have them laid out in step-by-step detail. You never know when you will make a mistake, and when you absolutely positively must fix a bug or add a feature by the next day, and need to refactor to do it, slow and steady wins the race.
Further, other refactorings are not so trivial and familiar, and it is certainly useful to have their traps and pitfalls exposed. Frequently, they rely on the smaller refactorings themselves.
I can see this book becoming well-used in a shop with plenty of production code.
Supplementary Material
The non-catalogue chapters are informative as well. I especially appreciate the metaphor of bad smells in the code: the "if it stinks, change it" philosophy is the perfect counter-point to the oft-cited "if it ain't broke, don't fix it" mentality.
The chapter on refactoring tools discusses the possibility of automating much of the mechanical work of refactoring. Although there is a Refactoring Browser for Smalltalk, I suspect that Java and C++ versions are a little ways off. I'd wager that, as with the UML, tool support will lag industry practice for some time.
Style
As always, the author's writing style is down-to-earth and easy to read. Martin tells you straight up what he's found useful and what he hasn't. He tells you where he's made mistakes, and where the risk is less pronounced.
I like the way he goes through an example, then goes through it again under different conditions, thereby revealing the many-splendoured variations. Frequently he continues examples that were left off from other refactorings.
Plenty of further reading is suggested; I always like that.
Flaws
The book has a Java focus, and that is the language used for the examples. There is some mention of Smalltalk and C++, but not much; far less than Design Patterns, for example. Still, the book is quite understandable to anyone with object-oriented development experience.
The book references design patterns; some refactorings even apply and manipulate patterns. However, I wish there were more direct references to the Design Patterns book. That would especially help those new to both refactorings and design patterns.
There are a few minor typos (nothing major), so check the author's web site for errata and try to get a recent printing if you can.
Recommendation
It's no secret that I think this is a book whose time has come. I'm hoping it will codify my approach to refactoring, to help me be more efficient in my development.
I recommend this book as both a practical catalogue, and as a general work on the theory and practice of refactoring. I think that the refactoring community will grow much as the patterns community before it, and that we will see more published on the subject.
Until then, this book is a good start.
Purchase this at Amazon.
TABLE OF CONTENTS
Foreword
Preface
1. Refactoring, a First Example
2. Principles in Refactoring
3. Bad Smells in Code
4. Building Tests
5. Toward a Catalog of Refactorings
6. Composing Methods
7. Moving Features Between Objects
8. Organizing Data
9. Simplifying Conditional Expressions
10. Making Method Calls Simpler
11. Dealing with Generalization
12. Big Refactorings
13. Refactoring, Reuse, and Reality
14. Refactoring Tools
15. Putting It All Together
References
List of Soundbites
Index -
Review:Real-Time Strategy Game Programming
Winning one of the longer title awards, SEGV has returned with a review, this time of Mickey Kawick's Real Time Strategy Game Programming using MS DirectX 6. For those of you want to know how to program the next Warcraft or Age of Empires, click below. Real-Time Strategy Game Programming author Mickey Kawick pages publisher Wordware Publishing rating 6 reviewer SEGV ISBN 1-55622-644-6 summary Marred by lack of focus and inferior editing, this book is only for the serious RTS programmer who is willing to overlook its weaknesses.Highly Anticipated
I found out about this book early this year. It was scheduled to be published in February by some small publisher I had never heard of. It was the only substantial source I could find on real-time strategy game programming, and it wasn't yet available. After a month or two of delay, it was released I ordered it directly from the publisher.
I couldn't wait for this book. It was aimed at intermediate to advanced programmers, so I had high expectations. I wanted something that would help me significantly in my own efforts to produce an RTS game for Linux. Even though the book was written using DirectX, it promised to cover game objects, landscape, pathing, and other such topics.
Initial Reactions
I was hopeful when the book arrived, after scanning through it. It had promising diagrams and meaty chapters on the topics I was interested in (Chapters 15-19, which actually comprise almost half the book). However, there was more DirectX coverage than I had bargained for.
The more I read, the more disappointed I became. I read the entire book, some parts several times, and indeed have used it while programming. It became clear to me that this book did not have the quality of an O'Reilly or Addison-Wesley product. What follows is an extensive deconstruction.
Topics
As evident from the table of contents, the book covers a lot of material. That lack of focus in itself is a flaw. I found the discussion of game ideas interesting, but I wanted a book devoted to the construction of RTS games, not their design. For the most part, Chapter 8 is composed of screenshots and descriptions of popular games in the genre, such as Age of Empires and Starcraft. You would think anyone purchasing this book would have played most of those games!
I found the discussions of the development cycle, coding style, and so forth in Chapter 3 excellent. But frankly, I have many great books on those topics and didn't need more. I think the same could probably be said for any intermediate to advanced reader. In the same vein, I didn't need information on data structures and utility libraries. Yet Chapter 6 is thrust upon me, composed of two pages of text and fifteen pages of source code from the CDROM (some of which the author admits to having never used).
Chapter 7 teaches the reader how to use the Visual C++ integrated development environment. It has screenshots of most wizard dialogs, and even gratuitous shots of the author's colour preferences and the Windows calculator. Is this intermediate to advanced fare?
While unrelated material receives valuable coverage, other important topics I was anxious to read about are shirked. There is no real coverage of multiplayer aspects or networking concerns. In addition, many topics are not covered deeply. For example, fog of war is described, yet the author presents no implementation details.
DirectX Coverage
I was hoping the DirectX material would be limited to some introductory chapters and API usage. As long as the algorithms were discussed, I could always port the code to another API myself.
Chapters 9, 10, 11, and 20 are fully DirectX specific. Chapters 12 through 14 cover additional graphics topics. That would be great, except I didn't need a graphics book. I'm not sure why the author feels a presentation of Bresenham's algorithm is in order (p222). Chapter 17, while not about DirectX, is highly Windows specific.
I can't say whether the DirectX code the author presents is quality or not, but if you are a DirectX programmer perhaps the book might appeal to you more.
Source Code
The author states in a note: "For this book, there was a lot of rewrite in order to make things more consistent and readable. I do not code this consistently or perfectly in real life."
I find that statement somewhat ironic, as I have many problems with the source code in the book. First of all, it is put forth as C++, yet makes heavy use of the preprocessor while avoiding the Standard Library. The author uses assignments in constructors where initializations are preferred. He also writes a standalone memory allocator instead of overloading operators new and delete (p579). That is not the C++ way.
The source code has absolute paths in its include directives (p106). The author employs leading underscores in his header guards (p121), and is not afraid to copy header declarations in order to decrease compile time (p159,241).
The author seems to miss the point of object-oriented programming, using inheritance to save typing (p307). The author derives from WORLDCOORDINATE such diverse classes as SINGLE_TILE and WORLDOBJECT (p426,529,531). Clearly the relationship should be containment, thereby expressing "has-a" as opposed to "is-a."
The author makes further coding errors, such as half-page-long virtual inline functions (p557-558) (see Effective C++ for details), recursive deletion of linked lists (p58) (which risks overflowing the stack), and incorrect copy constructor signatures (p631) (preventing copying of const objects).
The most intriguing error I see is premature optimization. For example (p389), the author "optimizes" a structure to 13 bytes, while noting that floating point members might increase its size. Yet padding would dictate that the structure occupy 16 bytes anyways, and indeed, that proves to be the case using the egcs-1.1.1 compiler.
One note the author writes (p363-364) is just plain wrong, apparently confusing the const and static keywords. The author also employs an incorrect syntax for bit fields (p388-389).
The author presents too much utility code. For example, not only does the author present seven and a half pages of container implementation, he repeats it later "for reference" (p336-343,629-637). Another seven pages of container implementation are, in the author's words, "nearly identical" (p678-685). Finally, if the reader needs yet another string class, one is presented (p293-300).
Editing
I'm not sure if the book was rushed or just poorly edited. Some paragraphs are just hard to understand, bordering on incomprehensible. But more often I find the author rambles, often repeating a paragraph, only slightly rephrased (p31,32,306).
The author writes in a confident tone, almost cocky. He is not afraid to tell the reader when his code is really good, although to be fair he also occasionally admits its shortcomings. Also, he seems to have an opinion on everything. I just think a little restraint would give his words more weight.
The gratuitous source listings should not have made it to publishing. I especially don't appreciate the author merely dumping unexplained untested code into the manuscript (p346-352).
I think strong editing could have helped those problems, and also imposed greater focus on the material. There seems to be a real confusion as to reader's skill level, which is supposedly intermediate to advanced. The author talks of the complexity of a doubly linked list as if the reader had never seen one before (p637).
Pedagogical Issues
The most glaring omission in this book is a sample game implementation. I would have been thrilled to have seen a tiny RTS game, even if it were implemented using DirectX on Windows. Instead, we are presented with libraries, code fragments, and demo apps.
The book could benefit from standard textbook fare: checklists, summaries, exercises, and the like. I find the index to be lacking. And although the author recommends Booch diagrams (forerunners of UML class diagrams) for understanding architecture, he only uses them twice, prefering instead to overwhelm the reader with source code.
Value
Is this book worth it? First, it's quite expensive. Although it is 700 pages long, much of that is padding. Really Chapters 15-19 are the meat of the book, and some of that information is available from other sources (eg, Game Developer articles and various web sites).
I've been extremely critical of this book, mostly because there are enough poor computer programming books without adding to their ranks, and enough excellent ones to serve as examples. Yet not all is marred. The book still has some excellent parts and good discussion. They are just overshadowed by its faults.
Unfortunately, this is the only book on real-time strategy game programming available. So, if you're really serious about programming such a beast, you'll probably want this book despite its shortcomings.
If you'd like to pick this book up, head over to Amazon.
TABLE OF CONTENTS
- Welcome
- Gameplay
- Getting Started on Your Game
- Documents
- Development
- Standard Macros and Data Types
- Background
- Great Ideas
- Working With DirectDraw
- How to Draw as Easy as 1, 2, 3
- How to do Your ABC's
- The Drawing Manager
- Loading Graphics
- The Black Space and the Wild Void of Life
- Animation
- The Landscape
- The Interface
- Objects and Creatures in the World
- Pathing
- DirectSound
-
Review:Real-Time Strategy Game Programming
Winning one of the longer title awards, SEGV has returned with a review, this time of Mickey Kawick's Real Time Strategy Game Programming using MS DirectX 6. For those of you want to know how to program the next Warcraft or Age of Empires, click below. Real-Time Strategy Game Programming author Mickey Kawick pages publisher Wordware Publishing rating 6 reviewer SEGV ISBN 1-55622-644-6 summary Marred by lack of focus and inferior editing, this book is only for the serious RTS programmer who is willing to overlook its weaknesses.Highly Anticipated
I found out about this book early this year. It was scheduled to be published in February by some small publisher I had never heard of. It was the only substantial source I could find on real-time strategy game programming, and it wasn't yet available. After a month or two of delay, it was released I ordered it directly from the publisher.
I couldn't wait for this book. It was aimed at intermediate to advanced programmers, so I had high expectations. I wanted something that would help me significantly in my own efforts to produce an RTS game for Linux. Even though the book was written using DirectX, it promised to cover game objects, landscape, pathing, and other such topics.
Initial Reactions
I was hopeful when the book arrived, after scanning through it. It had promising diagrams and meaty chapters on the topics I was interested in (Chapters 15-19, which actually comprise almost half the book). However, there was more DirectX coverage than I had bargained for.
The more I read, the more disappointed I became. I read the entire book, some parts several times, and indeed have used it while programming. It became clear to me that this book did not have the quality of an O'Reilly or Addison-Wesley product. What follows is an extensive deconstruction.
Topics
As evident from the table of contents, the book covers a lot of material. That lack of focus in itself is a flaw. I found the discussion of game ideas interesting, but I wanted a book devoted to the construction of RTS games, not their design. For the most part, Chapter 8 is composed of screenshots and descriptions of popular games in the genre, such as Age of Empires and Starcraft. You would think anyone purchasing this book would have played most of those games!
I found the discussions of the development cycle, coding style, and so forth in Chapter 3 excellent. But frankly, I have many great books on those topics and didn't need more. I think the same could probably be said for any intermediate to advanced reader. In the same vein, I didn't need information on data structures and utility libraries. Yet Chapter 6 is thrust upon me, composed of two pages of text and fifteen pages of source code from the CDROM (some of which the author admits to having never used).
Chapter 7 teaches the reader how to use the Visual C++ integrated development environment. It has screenshots of most wizard dialogs, and even gratuitous shots of the author's colour preferences and the Windows calculator. Is this intermediate to advanced fare?
While unrelated material receives valuable coverage, other important topics I was anxious to read about are shirked. There is no real coverage of multiplayer aspects or networking concerns. In addition, many topics are not covered deeply. For example, fog of war is described, yet the author presents no implementation details.
DirectX Coverage
I was hoping the DirectX material would be limited to some introductory chapters and API usage. As long as the algorithms were discussed, I could always port the code to another API myself.
Chapters 9, 10, 11, and 20 are fully DirectX specific. Chapters 12 through 14 cover additional graphics topics. That would be great, except I didn't need a graphics book. I'm not sure why the author feels a presentation of Bresenham's algorithm is in order (p222). Chapter 17, while not about DirectX, is highly Windows specific.
I can't say whether the DirectX code the author presents is quality or not, but if you are a DirectX programmer perhaps the book might appeal to you more.
Source Code
The author states in a note: "For this book, there was a lot of rewrite in order to make things more consistent and readable. I do not code this consistently or perfectly in real life."
I find that statement somewhat ironic, as I have many problems with the source code in the book. First of all, it is put forth as C++, yet makes heavy use of the preprocessor while avoiding the Standard Library. The author uses assignments in constructors where initializations are preferred. He also writes a standalone memory allocator instead of overloading operators new and delete (p579). That is not the C++ way.
The source code has absolute paths in its include directives (p106). The author employs leading underscores in his header guards (p121), and is not afraid to copy header declarations in order to decrease compile time (p159,241).
The author seems to miss the point of object-oriented programming, using inheritance to save typing (p307). The author derives from WORLDCOORDINATE such diverse classes as SINGLE_TILE and WORLDOBJECT (p426,529,531). Clearly the relationship should be containment, thereby expressing "has-a" as opposed to "is-a."
The author makes further coding errors, such as half-page-long virtual inline functions (p557-558) (see Effective C++ for details), recursive deletion of linked lists (p58) (which risks overflowing the stack), and incorrect copy constructor signatures (p631) (preventing copying of const objects).
The most intriguing error I see is premature optimization. For example (p389), the author "optimizes" a structure to 13 bytes, while noting that floating point members might increase its size. Yet padding would dictate that the structure occupy 16 bytes anyways, and indeed, that proves to be the case using the egcs-1.1.1 compiler.
One note the author writes (p363-364) is just plain wrong, apparently confusing the const and static keywords. The author also employs an incorrect syntax for bit fields (p388-389).
The author presents too much utility code. For example, not only does the author present seven and a half pages of container implementation, he repeats it later "for reference" (p336-343,629-637). Another seven pages of container implementation are, in the author's words, "nearly identical" (p678-685). Finally, if the reader needs yet another string class, one is presented (p293-300).
Editing
I'm not sure if the book was rushed or just poorly edited. Some paragraphs are just hard to understand, bordering on incomprehensible. But more often I find the author rambles, often repeating a paragraph, only slightly rephrased (p31,32,306).
The author writes in a confident tone, almost cocky. He is not afraid to tell the reader when his code is really good, although to be fair he also occasionally admits its shortcomings. Also, he seems to have an opinion on everything. I just think a little restraint would give his words more weight.
The gratuitous source listings should not have made it to publishing. I especially don't appreciate the author merely dumping unexplained untested code into the manuscript (p346-352).
I think strong editing could have helped those problems, and also imposed greater focus on the material. There seems to be a real confusion as to reader's skill level, which is supposedly intermediate to advanced. The author talks of the complexity of a doubly linked list as if the reader had never seen one before (p637).
Pedagogical Issues
The most glaring omission in this book is a sample game implementation. I would have been thrilled to have seen a tiny RTS game, even if it were implemented using DirectX on Windows. Instead, we are presented with libraries, code fragments, and demo apps.
The book could benefit from standard textbook fare: checklists, summaries, exercises, and the like. I find the index to be lacking. And although the author recommends Booch diagrams (forerunners of UML class diagrams) for understanding architecture, he only uses them twice, prefering instead to overwhelm the reader with source code.
Value
Is this book worth it? First, it's quite expensive. Although it is 700 pages long, much of that is padding. Really Chapters 15-19 are the meat of the book, and some of that information is available from other sources (eg, Game Developer articles and various web sites).
I've been extremely critical of this book, mostly because there are enough poor computer programming books without adding to their ranks, and enough excellent ones to serve as examples. Yet not all is marred. The book still has some excellent parts and good discussion. They are just overshadowed by its faults.
Unfortunately, this is the only book on real-time strategy game programming available. So, if you're really serious about programming such a beast, you'll probably want this book despite its shortcomings.
If you'd like to pick this book up, head over to Amazon.
TABLE OF CONTENTS
- Welcome
- Gameplay
- Getting Started on Your Game
- Documents
- Development
- Standard Macros and Data Types
- Background
- Great Ideas
- Working With DirectDraw
- How to Draw as Easy as 1, 2, 3
- How to do Your ABC's
- The Drawing Manager
- Loading Graphics
- The Black Space and the Wild Void of Life
- Animation
- The Landscape
- The Interface
- Objects and Creatures in the World
- Pathing
- DirectSound
-
Review:The Practice of Programming
SEGV has returned with a review of Kernighan and Pike's latest effort, The Practice of Programming This book has both practical and method aspects, including exercises. If you're serious about your programming, read below to get the skinny on the book. The Practice of Programming author Brian Kernighan and Rob Pike pages publisher Addison-Wesley rating 9 reviewer SEGV ISBN 0-201-61586-X summary Practical and enjoyable, this book captures its authors' considerable wisdom and experience on the practice of programming.This book is written by some heavyweights in the industry: Brian Kernighan and Rob Pike. I have not read previous efforts such as The UNIX Programming Environment or The C Programming Language, but I understand that they are excellent works. I was hoping that this book would live up to that pedigree.
I was not disappointed. The Practice of Programming is a great resource. I found the book to be a good mix of Steve McConnell's Code Complete, Steve Macguire's Writing Solid Code, and Jon Bentley's Programming Pearls: all excellent works in my experience.
Structure
The book offers nine solid chapters devoted to the practice of programming: the tasks that we perform every day to develop software. They range from the beginning of the process (eg, interface design) to the end (eg, testing); from higher-level considerations (eg, portability) to lower-level (eg, naming).
The authors provide examples culled from their real-world experience. I particularly enjoyed their debugging anecdotes, especially their hubris in discussing their own bugs. The authors also provide illustrative exercises, annotated supplementary reading, and an appendix of collected rules. The quality of these is high.
Style
Kernighan and Pike write with facility, clarity, and authority. It is easy to tell that their advice comes from wisdom and experience. I found the text to be readable and enjoyable, and the examples to be relevant and understandable.
The authors' presentation really makes this book valuable. It is neither dry nor difficult to read. In fact, even when they cover difficult material, they are careful to present it in an accessible manner. A college-level programmer should be able to absorb chapter 9, even though the authors build a toy VM with JIT compiler -- not a trivial undertaking.
Examples
The examples in this book really stand out. There are many, almost one per page. The bad examples are appropriately marked with '?' characters, the good examples are nicely commented, and each is concise and typically adapted from real code.
The authors employ many programming languages to illustrate their points. Although they have a distinct bias towards C and Awk, they also present C++, Java, and Perl code, and are careful to use idioms particular to each language.
Often, they will present several versions of the same program. When they do so, they discuss code length, clarity, and related issues, and compare performance, scrupulously noting the environments used.
For example, in chapter 3 they design a single program and implement it in C, Java, C++, Awk, and Perl. In chapter 6, they apply their testing tips to those programs. I appreciate this kind of continuity in a book.
Nitpickings
I have a few nitpicky comments regarding this book. I really don't like the authors' predilection for short local names, which seem clear in a book's example but aren't so sensible when being maintained in real-world code. The world would have been a better place with a
compare_stringsfunction instead ofstrcmp.Scott Meyers counsels us (More Effective C++ Item 6) to prefer preincrement to postincrement, yet the authors continue to use the latter in loop control statements. The authors also eschew Java's
boolean/false/truein favour ofint/0/1; for what reason, I am not sure.Still, these are nitpickings. Those issues are relatively minor, somewhat religious, and do not detract from the value of the book.
Summary
I think this is a good book, and I definitely recommend this sort of reading for colleagues of mine. If you've read the books I listed in the overview, then you can get by without this one. However, I feel that it doesn't hurt to be exposed to slightly different presentations of the same material, if only to reinforce the lessons learned.
While I read this book, I was engaged in a coding standards effort in my previous employment. I did find this book, in conjunction with others, to be a useful resource. In particular, I believe it is the most directly applicable book of its sort to development shops that have a lot of C code. That includes the Linux community.
The Practice of Programming is most suited to an intermediate level programmer, although beginning and advanced programmers will also find knowledge in its pages appropriate to their level.
The book's official site contains source code and other resources.
To purchase this book, head over to Amazon and help Slashdot out.
TABLE OF CONTENTS
Preface
Chapter 1: Style
Chapter 2: Algorithms and Data Structures
Chapter 3: Design and Implementation
Chapter 4: Interfaces
Chapter 5: Debugging
Chapter 6: Testing
Chapter 7: Performance
Chapter 8: Portability
Chapter 9: Notation
Epilogue
Appendix: Collected Rules
Index -
Review:Effective C++ CD-ROM
A name that all the book reviewers know SEGV has sent in a review of Scott Meyers' CD work Effective C++ CD. This is a stray from our normal book reviews, but figured people would appreciate seeing Scott Meyers' newest effort. Effective C++ CD author Scott Meyers pages publisher Addison Wesley rating 10 reviewer SEGV ISBN 0-201-60615-1 summary More than the sum of its hardcopy contents, this electronic resource earns a place on the programmer's bookshelf.What to Expect?
I wasn't sure exactly what to expect. Subtitled "85 Specific Ways to Improve Your Programs and Designs," I knew this CD was an electronic version of Scott Meyers' already-published books, which I had previously reviewed for Slashdot:
So I knew a priori that the content was excellent, but how would it be packaged and presented? Would it be Windows-only, forcing me to use it only at work as I run Linux at home? Would it be awkward to read onscreen? Would it be easily searchable? Could I annotate and print portions of it?
A Pleasant Surprise
I was pleasantly surprised when the package contained only a CDROM with these instructions printed on it:
To start, open INDEX.HTM
System requirements: Netscape Navigator 4.0+ (on Unix, Mac, or Win32) or Microsoft Internet Explorer 4.0+ (on Win32 only).So far so good! I had no problems using the CD with Communicator 4.5 on NT 4.0, and Communicator 4.04 on Debian GNU/Linux 2.0. Pretty much any modern browser with Java and JavaScript support should work. If you experience browser problems, the publisher provides helpful advice.
Initial Impressions
The CD has a nice look and feel to it. A navigation area is always present, acting as a control and providing a colour indication of where you are in the CD.
The text is decent to read and is true HTML, not merely raw text. It seems Meyers is conscious of the fact that an electronic version must add value to complement a printed version, otherwise it is not useful for its target audience.
Overall, I'd say this offering is a well though out and put together product, and not just a cheap knock-off.
Content
The CD (which itself has a printing number) contains the latest printings of the two books. It also boasts five magazine articles chosen by Meyers to augment the material in the books:
- "Exception Handling: A False Sense of Security" by Tom Cargill, from C++ Report Nov-Dec 1994.
- "Coping With Exceptions" by Jack W. Reeves, from C++ Report Mar 1996.
- "Exception-Safe Generic Containers" by Herb Sutter, from C++ Report Sep 1997, Nov-Dec 1997.
- "Counting Objects in C++" by Scott Meyers, from C/C++ Users Journal Apr 1998.
- "A First Look at C++ Program Analyzers" by Scott Meyers and Martin Klaus, from Dr. Dobb's Journal Feb 1997.
The first three are highly recommended for anyone dealing with exceptions. And of course, since any function may throw an exception, that means anyone writing C++! The object counting article elaborates on an idea from Effective C++ Item 14, illustrating some subtle language issues along the way. The final article outlines the state of the art in commercial static C++ analysis tools in September 1996.
Hyperlinks
The CD has links everywhere. Let me repeat: everywhere. In addition to hyperlinking existing references, Meyers added many cross references to the books and articles to further solidify the material.
Links to the internet at large are redirected through Addison Wesley Longman's online site so that they may stay current. And every single paragraph on the CD is anchored and hyperlinked, to facilitate electronic referencing and bookmarking.
Search Facilities
The CD provides two alternatives to your browser's "find in page" search facility. The first is a comprehensive merged index of the two books. The second is a search applet, modified from the Design Patterns CD search applet. It displays the resulting hits, with their enclosing paragraph for context if you select it. I found it easy to scan through hits until I found an interesting paragraph, then to jump to that document.
Although the search applet is aware of the entire CD, it appears that it can search only for one keyword. I'd really prefer more sophisticated search string options, such as multiple keywords, boolean operations, and perhaps even full regular expressions.
Configuration Facilities
For a set of web pages, the CD is impressively configurable. You can choose between five navigation area sizes, and five image sizes. You can view the books by item, by chapter, or in their entirety. And of course you can change text size in your browser.
Performance and Licensing
To implement the configurability options, there are actually five copies of each image and three copies of each book on the CD. Still, the total data size is a mere 16MB, which easily fits on a hard drive for greater performance and frees a CDROM drive for other use. This is also important because, given technology, actually altering the HTML files is really the only viable way of annotating the CD.
The CD comes with a single user license. You must contact the publisher for additional network license options. The short story is: you can make the CD available on a non-internet-accessible server to as many users as you have licenses, and you can purchase additional network licenses more cheaply the more you buy.
Summary
I've been using the CD both at work and at home for a couple of weeks, and I continue to find it a valuable resource. It easily subs in for my absent printed books, although of course I can't use it without a computer. The articles are useful, and the index and search applet allow me to quickly find what I am looking for.
Really, I have only three complaints:
- the search applet is somewhat limited
- there could be more magazine articles
- Scott's author photo is starting to look less like Eddie Van Halen and more like Gene Simmons
However, I don't think any of those detracts from the CD enough to reduce its 10/10 rating. In the worst case, since the CD is composed of text HTML files, you could apply other search utilities (eg, grep) to it.
The CD's online site has a demo, which I recommend trying if you want to get a feel for the CD before you purchase it. In addition to the general look and feel, navigation area, and search applet, it includes all of the magazine articles and a few of the books' items.
I'm happy with the CD, and recommend it as a professional resource.
To pick this up and help Slashdot, head over to Computer Literacy.
TABLE OF CONTENTS
Introduction
Effective C++ Second Edition
More Effective C++
Magazine Articles
Search the CD -
Review:Effective C++ CD-ROM
A name that all the book reviewers know SEGV has sent in a review of Scott Meyers' CD work Effective C++ CD. This is a stray from our normal book reviews, but figured people would appreciate seeing Scott Meyers' newest effort. Effective C++ CD author Scott Meyers pages publisher Addison Wesley rating 10 reviewer SEGV ISBN 0-201-60615-1 summary More than the sum of its hardcopy contents, this electronic resource earns a place on the programmer's bookshelf.What to Expect?
I wasn't sure exactly what to expect. Subtitled "85 Specific Ways to Improve Your Programs and Designs," I knew this CD was an electronic version of Scott Meyers' already-published books, which I had previously reviewed for Slashdot:
So I knew a priori that the content was excellent, but how would it be packaged and presented? Would it be Windows-only, forcing me to use it only at work as I run Linux at home? Would it be awkward to read onscreen? Would it be easily searchable? Could I annotate and print portions of it?
A Pleasant Surprise
I was pleasantly surprised when the package contained only a CDROM with these instructions printed on it:
To start, open INDEX.HTM
System requirements: Netscape Navigator 4.0+ (on Unix, Mac, or Win32) or Microsoft Internet Explorer 4.0+ (on Win32 only).So far so good! I had no problems using the CD with Communicator 4.5 on NT 4.0, and Communicator 4.04 on Debian GNU/Linux 2.0. Pretty much any modern browser with Java and JavaScript support should work. If you experience browser problems, the publisher provides helpful advice.
Initial Impressions
The CD has a nice look and feel to it. A navigation area is always present, acting as a control and providing a colour indication of where you are in the CD.
The text is decent to read and is true HTML, not merely raw text. It seems Meyers is conscious of the fact that an electronic version must add value to complement a printed version, otherwise it is not useful for its target audience.
Overall, I'd say this offering is a well though out and put together product, and not just a cheap knock-off.
Content
The CD (which itself has a printing number) contains the latest printings of the two books. It also boasts five magazine articles chosen by Meyers to augment the material in the books:
- "Exception Handling: A False Sense of Security" by Tom Cargill, from C++ Report Nov-Dec 1994.
- "Coping With Exceptions" by Jack W. Reeves, from C++ Report Mar 1996.
- "Exception-Safe Generic Containers" by Herb Sutter, from C++ Report Sep 1997, Nov-Dec 1997.
- "Counting Objects in C++" by Scott Meyers, from C/C++ Users Journal Apr 1998.
- "A First Look at C++ Program Analyzers" by Scott Meyers and Martin Klaus, from Dr. Dobb's Journal Feb 1997.
The first three are highly recommended for anyone dealing with exceptions. And of course, since any function may throw an exception, that means anyone writing C++! The object counting article elaborates on an idea from Effective C++ Item 14, illustrating some subtle language issues along the way. The final article outlines the state of the art in commercial static C++ analysis tools in September 1996.
Hyperlinks
The CD has links everywhere. Let me repeat: everywhere. In addition to hyperlinking existing references, Meyers added many cross references to the books and articles to further solidify the material.
Links to the internet at large are redirected through Addison Wesley Longman's online site so that they may stay current. And every single paragraph on the CD is anchored and hyperlinked, to facilitate electronic referencing and bookmarking.
Search Facilities
The CD provides two alternatives to your browser's "find in page" search facility. The first is a comprehensive merged index of the two books. The second is a search applet, modified from the Design Patterns CD search applet. It displays the resulting hits, with their enclosing paragraph for context if you select it. I found it easy to scan through hits until I found an interesting paragraph, then to jump to that document.
Although the search applet is aware of the entire CD, it appears that it can search only for one keyword. I'd really prefer more sophisticated search string options, such as multiple keywords, boolean operations, and perhaps even full regular expressions.
Configuration Facilities
For a set of web pages, the CD is impressively configurable. You can choose between five navigation area sizes, and five image sizes. You can view the books by item, by chapter, or in their entirety. And of course you can change text size in your browser.
Performance and Licensing
To implement the configurability options, there are actually five copies of each image and three copies of each book on the CD. Still, the total data size is a mere 16MB, which easily fits on a hard drive for greater performance and frees a CDROM drive for other use. This is also important because, given technology, actually altering the HTML files is really the only viable way of annotating the CD.
The CD comes with a single user license. You must contact the publisher for additional network license options. The short story is: you can make the CD available on a non-internet-accessible server to as many users as you have licenses, and you can purchase additional network licenses more cheaply the more you buy.
Summary
I've been using the CD both at work and at home for a couple of weeks, and I continue to find it a valuable resource. It easily subs in for my absent printed books, although of course I can't use it without a computer. The articles are useful, and the index and search applet allow me to quickly find what I am looking for.
Really, I have only three complaints:
- the search applet is somewhat limited
- there could be more magazine articles
- Scott's author photo is starting to look less like Eddie Van Halen and more like Gene Simmons
However, I don't think any of those detracts from the CD enough to reduce its 10/10 rating. In the worst case, since the CD is composed of text HTML files, you could apply other search utilities (eg, grep) to it.
The CD's online site has a demo, which I recommend trying if you want to get a feel for the CD before you purchase it. In addition to the general look and feel, navigation area, and search applet, it includes all of the magazine articles and a few of the books' items.
I'm happy with the CD, and recommend it as a professional resource.
To pick this up and help Slashdot, head over to Computer Literacy.
TABLE OF CONTENTS
Introduction
Effective C++ Second Edition
More Effective C++
Magazine Articles
Search the CD -
Review:Rise & Resurrection of the American Programmer
SEGV, the old faithful of reviews, has sent in one of his latest reviews, this one of Edward Yourdon's latest book Rise and Resurrection of the American Programmer. For those of you who remember, several years ago, Yourdon wrote a book about how the American programmer/developer was doomed. Recent years have changed his opinion, and in this book he talks about the change that he says across the landscape. Fascinating idea-click below for the review. Rise and Resurrection of the American Programmer author Edward Yourdon pages publisher Prentice-Hall, Inc. rating 8.5 reviewer SEGV ISBN 0-13-121831-X summary A few years later, this industry autopsy remains an interesting and insightful read.Decline and Fall
In the beginning of this decade, Edward Yourdon wrote Decline and Fall of the American Programmer, a pessimistic assessment of the American software industry in the global marketplace. I haven't read that book, but Ed conveniently summarizes it in the first chapter of this book.
His premise was simple: North American programmers are more expensive, less productive, and produce lower quality software than programmers elsewhere in the world. Therefore, he argued, competitive forces will drive them into extinction. He backed this up with a battery of data, figures, case studies, and anecdotal evidence.
This was apparently a wake-up call. After all, Ed wasn't merely an ignorant consultant. Rather, with 35 years in the industry, he had programmed mainframes and helped to invent structure design methodology. People listened to him.
Rise and Resurrection
But something happened during the first half of this decade. Not all of Ed's predictions came true; not all software development migrated to Bangalore, India; not all American programmers fell off the evolutionary ladder.
This book, Rise and Resurrection of the American Programmer, was written mid-decade to reexamine the situation then. Remember 1995? The web was just taking off, Microsoft Windows 95 was just released, Java was just beta, and Linux was just a hacker's toy.
Now the decade is closing, Ed is focusing on Y2K issues, and I've just finished reading this book. Some of Ed's views have dated, and some remain relevant. I'll try to enumerate a few of them here.
Java and the Internet
Ed stressed the importance of corporations embracing the internet. After all, he argued, competitors will. This has turned out to be correct. He also was extremely enthusiastic about Java, which wasn't even shipping when he wrote the book. Although most of the chapter explains the language and environment, and ends up sounding like a Sun white paper, one interesting nugget is Ed's suggestion that Microsoft may simply "embrace and assimilate" Java for themselves.
The Microsoft Paradigm
Let's be frank; Microsoft is quite successful, and does some things right. Ed dissects the corporation and comes to several conclusions. With section headings such as "The Dark Side of the Force" and "Into the Belly of the Beast," this chapter acknowledges public sentiment and should interest most Slashdot readers. But Ed concludes that Microsoft's hackers are growing up, and the corporation's powerful position will be difficult to assault.
Linux and Open Source Software
Ed pretty much missed this one. I didn't see any mention of Linux, hardly a blip on the radar when this book was written. Curiously, I also didn't see any mention of open source software, a wider concept that has been around for decades.
The closest hint I saw of the rising phenomenon was regarding Java's ability to change the economics of paying for software. Ed suggested that downloadable applets and web interaction make it possible to sell a "one-time usage" of software components, which could threaten existing software vendors with monolithic products.
An Enjoyable Read
At just over 300 pages, this book covers quite a few topics. I thought the chapters on peopleware and good-enough software were quite well done. Other chapters spurred me to learn more about the Capability Maturity Model and Personal Software Practices.
Ed is a frank and readable writer, and the book is quite digestible. It's fun to read recent predictions and analyze where they went wrong, and right (remember, hindsight's 20/20!). The book is almost a time capsule of the mid-nineties, which coincidentally being when I started working with computers in earnest was a refreshing read for myself. I think it will be for you as well.
Ed's web site is at www.yourdon.com.
Buy this book here.
TABLE OF CONTENTS
Preface
Trademark Acknowledgements
Part One: Decline & Fall Reexamined
1. The Original Premise
2. Peopleware
3. The Other Silver Bullets
Part Two: Repaving Cowpaths
4. System Dynamics
5. Personal Software Practices
6. Best Practices
7. Good-Enough Software
Part Three: The Brave New World
8. Service Systems
9. The Internet
10. Java and the New Programming Paradigm
11. The Microsoft Paradigm
12. Embedded Systems and Brave New Worlds
13. Past, Present, and Future
Appendix: An Updated Programmer's Bookshelf
Index -
Review:Concurrent Programming in Java: Design Principles and Patterns
Veteran reviewer SEGV has sent in his latest literary exploit, a review of Doug Lea's book Concurrent Programming in Java: Design Principles and Patterns. Not exactly a book for the beginning, this is design for those of you who know their way around Java, and are looking to firm up your theory base. Given the recent lawsuit end, it appears that a lot more attention is being focused on Java again. Let's trya nd get some real programming done for it. Concurrent Programming in Java: Design Principles and Patterns author Doug Lea pages publisher Addison-Wesley rating 8/10 reviewer SEGV ISBN 0-201-69581-2 summary Not for beginners, this advanced book is perhaps somewhat hard to follow in places but rewarding to those who persevereConcurrent Programming in Java: Design Principles and Patterns,
by Doug Lea
[Addison-Wesley, ISBN 0-201-69581-2]
Nutshell
Review:Not for beginners, this advanced book is perhaps somewhat hard to follow in places but rewarding to those who persevere.
Rating: 8/10
A Book on Concurrent Programming
Concurrent Programming in Java is not just a book on Java threads. Rather, this 339 page book from JavaSoft's Java Series delves into the unique problems and solutions of concurrent programming. It just happens to use Java as its example language. Sure, you'll learn how to use Java constructs such as
synchronized,volatile,wait,notify, andnotifyAll. But you'll also learn how to put them together properly in an architecture that works.The book has an online site with an excellent overview and supplement (containing errata, code, applets, and more).
Impressions
This was the first book dedicated to concurrent programming that I read. I absorbed it over the course of a month while dealing with serious threading issues in a major shipping product. Since then I've read half of Butenhof's Programming with POSIX Threads (which cites Lea's book), so I have a bit of perspective.
This is definitely not a book for the casual reader. If that's what you need or want, check out the aforementioned Butenhof book. They each deal with concurrent programming in general, but Butenhof's is easier to read (even has cartoons), explains things more accessibly, and overall is a better introduction.
However, if you want a book with no holds barred content, without frivolous diagrams and overblown examples, then this is it. It's a tough read. You have to work to understand how the examples illustrate the text. But we are better off that Lea does not spoon feed us. I came away from this book with a greater understanding of concurrent programming, and to that end it succeeded.
Content
From the table of contents you can see that Lea begins with an introduction. Not only does it frame subsequent chapters, it contains an 8 page further readings section containing references on everything from threads in particular to related topics in general. Subsequent chapters also have a further readings section, though not as overwhelming as the first.
Chapters two and three cover safety and liveness issues, the Scylla and Charybdes of concurrent programming. The former ensures that your program works correctly (eg, no race conditions or deadlocks), and the latter ensures that it does so effectively (ie, not reduced to a single thread). Lea doesn't just explain the pitfalls, but demonstrates the designs and techniques to get around them.
The next chapter covers controlling a thread's action based on its state. I found the discussion of policies of how to proceed when in the wrong state particularly useful. And of course guarded suspension is pivotal in concurrent programming.
The final four chapters take us from raw building blocks to higher level constructs. Lea introduces patterns which serve to control concurrency, allow for services, organize flow, and coordinate everything. Need to solve the readers and writers problem? Want to join a few threads? Perhaps you need to use an assembly line? Or maybe you're interested in transactions? These chapters have all that, and then some.
Summary
I find this book useful, even when I'm not doing Java. The only thing that stops me from purchasing my own copy is that another is readily accessible, and I hope that a second edition will come out that I can get instead!
It's a good book on concurrent programming. I just think it is only worth tackling if you have a strong backing in computer programming, and perhaps design patterns. Then, the text will make more sense and will serve as a good reference.
If you're more of a beginner or intermediate, I'd look elsewhere for a more appropriate book. You'll be better served than by struggling through this one. But certainly come back to it when you can!
Pick this book up at Amazon.
TABLE OF CONTENTS
Preface
Introduction
Applications of Concurrency, Overview, Java Concurrency Support, Further Readings
Safety
Safe Objects, Immutable Objects, Fully Synchronized Objects, Contained Objects, Further Readings
Liveness
Liveness Failures, Instance Variable Analysis, Splitting Synchronization, Further Readings
State-Dependent Action
Policies, Representing State, Guarded Suspension, Balking, Further Readings
Concurrency Control
Subclassing, Adapters and Delegation, Acceptors, Models and Mappings, Further Readings
Services in Threads
Styles and Policies, Commands, Completion, Group Services, Coexistence, Further Readings
Flow
Applications, Flow Policies, Resource Management, Assembly Line, Further Readings
Coordinated Action
Transactions, Notification, Scheduling, Further Readings
Index -
Review:Concurrent Programming in Java: Design Principles and Patterns
Veteran reviewer SEGV has sent in his latest literary exploit, a review of Doug Lea's book Concurrent Programming in Java: Design Principles and Patterns. Not exactly a book for the beginning, this is design for those of you who know their way around Java, and are looking to firm up your theory base. Given the recent lawsuit end, it appears that a lot more attention is being focused on Java again. Let's trya nd get some real programming done for it. Concurrent Programming in Java: Design Principles and Patterns author Doug Lea pages publisher Addison-Wesley rating 8/10 reviewer SEGV ISBN 0-201-69581-2 summary Not for beginners, this advanced book is perhaps somewhat hard to follow in places but rewarding to those who persevereConcurrent Programming in Java: Design Principles and Patterns,
by Doug Lea
[Addison-Wesley, ISBN 0-201-69581-2]
Nutshell
Review:Not for beginners, this advanced book is perhaps somewhat hard to follow in places but rewarding to those who persevere.
Rating: 8/10
A Book on Concurrent Programming
Concurrent Programming in Java is not just a book on Java threads. Rather, this 339 page book from JavaSoft's Java Series delves into the unique problems and solutions of concurrent programming. It just happens to use Java as its example language. Sure, you'll learn how to use Java constructs such as
synchronized,volatile,wait,notify, andnotifyAll. But you'll also learn how to put them together properly in an architecture that works.The book has an online site with an excellent overview and supplement (containing errata, code, applets, and more).
Impressions
This was the first book dedicated to concurrent programming that I read. I absorbed it over the course of a month while dealing with serious threading issues in a major shipping product. Since then I've read half of Butenhof's Programming with POSIX Threads (which cites Lea's book), so I have a bit of perspective.
This is definitely not a book for the casual reader. If that's what you need or want, check out the aforementioned Butenhof book. They each deal with concurrent programming in general, but Butenhof's is easier to read (even has cartoons), explains things more accessibly, and overall is a better introduction.
However, if you want a book with no holds barred content, without frivolous diagrams and overblown examples, then this is it. It's a tough read. You have to work to understand how the examples illustrate the text. But we are better off that Lea does not spoon feed us. I came away from this book with a greater understanding of concurrent programming, and to that end it succeeded.
Content
From the table of contents you can see that Lea begins with an introduction. Not only does it frame subsequent chapters, it contains an 8 page further readings section containing references on everything from threads in particular to related topics in general. Subsequent chapters also have a further readings section, though not as overwhelming as the first.
Chapters two and three cover safety and liveness issues, the Scylla and Charybdes of concurrent programming. The former ensures that your program works correctly (eg, no race conditions or deadlocks), and the latter ensures that it does so effectively (ie, not reduced to a single thread). Lea doesn't just explain the pitfalls, but demonstrates the designs and techniques to get around them.
The next chapter covers controlling a thread's action based on its state. I found the discussion of policies of how to proceed when in the wrong state particularly useful. And of course guarded suspension is pivotal in concurrent programming.
The final four chapters take us from raw building blocks to higher level constructs. Lea introduces patterns which serve to control concurrency, allow for services, organize flow, and coordinate everything. Need to solve the readers and writers problem? Want to join a few threads? Perhaps you need to use an assembly line? Or maybe you're interested in transactions? These chapters have all that, and then some.
Summary
I find this book useful, even when I'm not doing Java. The only thing that stops me from purchasing my own copy is that another is readily accessible, and I hope that a second edition will come out that I can get instead!
It's a good book on concurrent programming. I just think it is only worth tackling if you have a strong backing in computer programming, and perhaps design patterns. Then, the text will make more sense and will serve as a good reference.
If you're more of a beginner or intermediate, I'd look elsewhere for a more appropriate book. You'll be better served than by struggling through this one. But certainly come back to it when you can!
Pick this book up at Amazon.
TABLE OF CONTENTS
Preface
Introduction
Applications of Concurrency, Overview, Java Concurrency Support, Further Readings
Safety
Safe Objects, Immutable Objects, Fully Synchronized Objects, Contained Objects, Further Readings
Liveness
Liveness Failures, Instance Variable Analysis, Splitting Synchronization, Further Readings
State-Dependent Action
Policies, Representing State, Guarded Suspension, Balking, Further Readings
Concurrency Control
Subclassing, Adapters and Delegation, Acceptors, Models and Mappings, Further Readings
Services in Threads
Styles and Policies, Commands, Completion, Group Services, Coexistence, Further Readings
Flow
Applications, Flow Policies, Resource Management, Assembly Line, Further Readings
Coordinated Action
Transactions, Notification, Scheduling, Further Readings
Index -
Review:Concurrent Programming in Java: Design Principles and Patterns
Veteran reviewer SEGV has sent in his latest literary exploit, a review of Doug Lea's book Concurrent Programming in Java: Design Principles and Patterns. Not exactly a book for the beginning, this is design for those of you who know their way around Java, and are looking to firm up your theory base. Given the recent lawsuit end, it appears that a lot more attention is being focused on Java again. Let's trya nd get some real programming done for it. Concurrent Programming in Java: Design Principles and Patterns author Doug Lea pages publisher Addison-Wesley rating 8/10 reviewer SEGV ISBN 0-201-69581-2 summary Not for beginners, this advanced book is perhaps somewhat hard to follow in places but rewarding to those who persevereConcurrent Programming in Java: Design Principles and Patterns,
by Doug Lea
[Addison-Wesley, ISBN 0-201-69581-2]
Nutshell
Review:Not for beginners, this advanced book is perhaps somewhat hard to follow in places but rewarding to those who persevere.
Rating: 8/10
A Book on Concurrent Programming
Concurrent Programming in Java is not just a book on Java threads. Rather, this 339 page book from JavaSoft's Java Series delves into the unique problems and solutions of concurrent programming. It just happens to use Java as its example language. Sure, you'll learn how to use Java constructs such as
synchronized,volatile,wait,notify, andnotifyAll. But you'll also learn how to put them together properly in an architecture that works.The book has an online site with an excellent overview and supplement (containing errata, code, applets, and more).
Impressions
This was the first book dedicated to concurrent programming that I read. I absorbed it over the course of a month while dealing with serious threading issues in a major shipping product. Since then I've read half of Butenhof's Programming with POSIX Threads (which cites Lea's book), so I have a bit of perspective.
This is definitely not a book for the casual reader. If that's what you need or want, check out the aforementioned Butenhof book. They each deal with concurrent programming in general, but Butenhof's is easier to read (even has cartoons), explains things more accessibly, and overall is a better introduction.
However, if you want a book with no holds barred content, without frivolous diagrams and overblown examples, then this is it. It's a tough read. You have to work to understand how the examples illustrate the text. But we are better off that Lea does not spoon feed us. I came away from this book with a greater understanding of concurrent programming, and to that end it succeeded.
Content
From the table of contents you can see that Lea begins with an introduction. Not only does it frame subsequent chapters, it contains an 8 page further readings section containing references on everything from threads in particular to related topics in general. Subsequent chapters also have a further readings section, though not as overwhelming as the first.
Chapters two and three cover safety and liveness issues, the Scylla and Charybdes of concurrent programming. The former ensures that your program works correctly (eg, no race conditions or deadlocks), and the latter ensures that it does so effectively (ie, not reduced to a single thread). Lea doesn't just explain the pitfalls, but demonstrates the designs and techniques to get around them.
The next chapter covers controlling a thread's action based on its state. I found the discussion of policies of how to proceed when in the wrong state particularly useful. And of course guarded suspension is pivotal in concurrent programming.
The final four chapters take us from raw building blocks to higher level constructs. Lea introduces patterns which serve to control concurrency, allow for services, organize flow, and coordinate everything. Need to solve the readers and writers problem? Want to join a few threads? Perhaps you need to use an assembly line? Or maybe you're interested in transactions? These chapters have all that, and then some.
Summary
I find this book useful, even when I'm not doing Java. The only thing that stops me from purchasing my own copy is that another is readily accessible, and I hope that a second edition will come out that I can get instead!
It's a good book on concurrent programming. I just think it is only worth tackling if you have a strong backing in computer programming, and perhaps design patterns. Then, the text will make more sense and will serve as a good reference.
If you're more of a beginner or intermediate, I'd look elsewhere for a more appropriate book. You'll be better served than by struggling through this one. But certainly come back to it when you can!
Pick this book up at Amazon.
TABLE OF CONTENTS
Preface
Introduction
Applications of Concurrency, Overview, Java Concurrency Support, Further Readings
Safety
Safe Objects, Immutable Objects, Fully Synchronized Objects, Contained Objects, Further Readings
Liveness
Liveness Failures, Instance Variable Analysis, Splitting Synchronization, Further Readings
State-Dependent Action
Policies, Representing State, Guarded Suspension, Balking, Further Readings
Concurrency Control
Subclassing, Adapters and Delegation, Acceptors, Models and Mappings, Further Readings
Services in Threads
Styles and Policies, Commands, Completion, Group Services, Coexistence, Further Readings
Flow
Applications, Flow Policies, Resource Management, Assembly Line, Further Readings
Coordinated Action
Transactions, Notification, Scheduling, Further Readings
Index -
Review:More Effective C++
SEGV, another of our resident book reviewers has written a review of the new Scott Meyer's book More Effective C++: 35 New Ways to Improve Your Programs and Designs. This is a follow-up to his previous book, and is designed for people familiar with the language.
On a different note, if you are interested in reviewing, drop me a line. We need more reviews, and I even have some books to send out as tank oos. More Effective C++: 35 New Ways to Improve Your Programs and Designs author Scott Meyers pages publisher Addison-Wesley rating 8/10 reviewer SEGV ISBN 0-201-63371-X summary A fitting follow-up to a practical classic.More Effective C++: 35 New Ways to Improve Your Programs and Designs,
by Scott Meyers
[Addison-Wesley, ISBN 0-201-63371-X]
Nutshell
Review:A fitting follow-up to a practical classic.
Rating: 8/10
Episode VI: Return of the Guru
Scott Meyers has penned a worthy sequel to his original classic (now in its second edition, reviewed here). More Effecive C++ [online site] continues with the same style and quality, allowing the aspiring C++ student to further her skills with this powerful language.
Scope
This book pretty much assumes that you're familiar with the foundation laid in its predecessor. Because of that, it is able to skip the "basics" (like "use delete on pointer members") and get into more advanced topics.
Although it covers fewer Items, it is a larger book by quite a bit. Some Items are full (20+ pages) treatments of complex subjects, such as implementing smart pointers. Meyers takes you through all the nitty-gritty details of the topic at hand; by the time you're finished an Item, you not only know one or two Right Ways to do something, but also half a dozen Wrong Ways!
Content
After a brief treatment of a few more "basic" Items, Meyers leaps into a discussion of operators. Here he covers some points not present in the first book.
If you are using exceptions at all, the next Items will go far towards justifying the cost of this book. We hear about thread-safety, but often forget about exception-safety. Typically, the latter causes resource leaks, which are not as visible as the crashes caused by the former. Meyers not only explains the finer details of using exceptions properly, he also demonstrates idioms to make cleaning up after your code's mess easy and automatic.
Next Meyers discusses ways to help your code perform better and faster. Some are specific, lower level techniques, such as organizing your functions to facilitate the return value optimization. Others are generic, higher level techniques such as lazy evaluation, but it's valuable to see them illustrated in C++. All give you a deeper understanding of how C++ goes about its business.
The next Items are a set of techniques that you can apply in C++. These idioms may help you solve particular problems: for example, making functions virtual with respect to more than one object is how the Visitor pattern is implemented in C++. Even if you use existing code, such as
auto_ptr, it's enlightening and instructive to see exactly what's going on under the hood, as with smart pointers.Finally, Meyers wraps up his treatise with some more general Items. I particularly like his idea of programming in the future tense. What he really means, is write code as it should be, not just as the compiler allows. If your design calls for constraints, enforce them in the code. Don't break encapsulation just for convenience. Build in flexibility. And so on.
Summary
I recommend this book. It's not as reference-worthy as its predecessor, but it has its own place on your bookshelf. It bears reading even if you borrow a copy.
Buy this book over this way.
TABLE OF CONTENTS
Acknowledgements
Introduction
Basics
Item 1: Distinguish between pointers and references
Item 2: Prefer C++-style casts
Item 3: Never treat arrays polymorphically
Item 4: Avoid gratuitous default constructors
Operators
Item 5: Be wary of user-defined conversion functions
Item 6: Distinguish between prefix and postfix forms of increment and decrement operators
Item 7: Never overload&&,||, or,
Item 8: Understand the different meanings ofnewanddelete
Exceptions
Item 9: Use destructors to prevent resource leaks
Item 10: Prevent resource leaks in constructors
Item 11: Prevent exceptions from leaving destructors
Item 12: Understand how throwing an exception differs from passing a parameter or calling a virtual function
Item 13: Catch exceptions by reference
Item 14: Use exception specifications judiciously
Item 15: Understand the costs of exception handling
Efficiency
Item 16: Remember the 80-20 rule
Item 17: Consider using lazy evaluation
Item 18: Amortize the cost of expected computations
Item 19: Understand the origin of temporary objects
Item 20: Facilitate the return value optimization
Item 21: Overload to avoid implicit type conversions
Item 22: Consider using op= instead of stand-alone op
Item 23: Consider alternative libraries
Item 24: Understand the costs of virtual functions, multiple inheritance, virtual base classes, and RTTI
Techniques
Item 25: Virtualizing constructors and non-member functions
Item 26: Limiting the number of objects of a class
Item 27: Requiring or prohibiting heap-based objects
Item 28: Smart pointers
Item 29: Reference counting
Item 30: Proxy classes
Item 31: Making functions virtual with respect to more than one object
Miscellany
Item 32: Program in the future tense
Item 33: Make non-leaf classes abstract
Item 34: Understand how to combine C++ and C in the same program
Item 35: Familiarize yourself with the language standard
Recommended Reading
An
auto_ptrImplementationGeneral Index
Index of Example Classes, Functions, and Templates
-
Review:More Effective C++
SEGV, another of our resident book reviewers has written a review of the new Scott Meyer's book More Effective C++: 35 New Ways to Improve Your Programs and Designs. This is a follow-up to his previous book, and is designed for people familiar with the language.
On a different note, if you are interested in reviewing, drop me a line. We need more reviews, and I even have some books to send out as tank oos. More Effective C++: 35 New Ways to Improve Your Programs and Designs author Scott Meyers pages publisher Addison-Wesley rating 8/10 reviewer SEGV ISBN 0-201-63371-X summary A fitting follow-up to a practical classic.More Effective C++: 35 New Ways to Improve Your Programs and Designs,
by Scott Meyers
[Addison-Wesley, ISBN 0-201-63371-X]
Nutshell
Review:A fitting follow-up to a practical classic.
Rating: 8/10
Episode VI: Return of the Guru
Scott Meyers has penned a worthy sequel to his original classic (now in its second edition, reviewed here). More Effecive C++ [online site] continues with the same style and quality, allowing the aspiring C++ student to further her skills with this powerful language.
Scope
This book pretty much assumes that you're familiar with the foundation laid in its predecessor. Because of that, it is able to skip the "basics" (like "use delete on pointer members") and get into more advanced topics.
Although it covers fewer Items, it is a larger book by quite a bit. Some Items are full (20+ pages) treatments of complex subjects, such as implementing smart pointers. Meyers takes you through all the nitty-gritty details of the topic at hand; by the time you're finished an Item, you not only know one or two Right Ways to do something, but also half a dozen Wrong Ways!
Content
After a brief treatment of a few more "basic" Items, Meyers leaps into a discussion of operators. Here he covers some points not present in the first book.
If you are using exceptions at all, the next Items will go far towards justifying the cost of this book. We hear about thread-safety, but often forget about exception-safety. Typically, the latter causes resource leaks, which are not as visible as the crashes caused by the former. Meyers not only explains the finer details of using exceptions properly, he also demonstrates idioms to make cleaning up after your code's mess easy and automatic.
Next Meyers discusses ways to help your code perform better and faster. Some are specific, lower level techniques, such as organizing your functions to facilitate the return value optimization. Others are generic, higher level techniques such as lazy evaluation, but it's valuable to see them illustrated in C++. All give you a deeper understanding of how C++ goes about its business.
The next Items are a set of techniques that you can apply in C++. These idioms may help you solve particular problems: for example, making functions virtual with respect to more than one object is how the Visitor pattern is implemented in C++. Even if you use existing code, such as
auto_ptr, it's enlightening and instructive to see exactly what's going on under the hood, as with smart pointers.Finally, Meyers wraps up his treatise with some more general Items. I particularly like his idea of programming in the future tense. What he really means, is write code as it should be, not just as the compiler allows. If your design calls for constraints, enforce them in the code. Don't break encapsulation just for convenience. Build in flexibility. And so on.
Summary
I recommend this book. It's not as reference-worthy as its predecessor, but it has its own place on your bookshelf. It bears reading even if you borrow a copy.
Buy this book over this way.
TABLE OF CONTENTS
Acknowledgements
Introduction
Basics
Item 1: Distinguish between pointers and references
Item 2: Prefer C++-style casts
Item 3: Never treat arrays polymorphically
Item 4: Avoid gratuitous default constructors
Operators
Item 5: Be wary of user-defined conversion functions
Item 6: Distinguish between prefix and postfix forms of increment and decrement operators
Item 7: Never overload&&,||, or,
Item 8: Understand the different meanings ofnewanddelete
Exceptions
Item 9: Use destructors to prevent resource leaks
Item 10: Prevent resource leaks in constructors
Item 11: Prevent exceptions from leaving destructors
Item 12: Understand how throwing an exception differs from passing a parameter or calling a virtual function
Item 13: Catch exceptions by reference
Item 14: Use exception specifications judiciously
Item 15: Understand the costs of exception handling
Efficiency
Item 16: Remember the 80-20 rule
Item 17: Consider using lazy evaluation
Item 18: Amortize the cost of expected computations
Item 19: Understand the origin of temporary objects
Item 20: Facilitate the return value optimization
Item 21: Overload to avoid implicit type conversions
Item 22: Consider using op= instead of stand-alone op
Item 23: Consider alternative libraries
Item 24: Understand the costs of virtual functions, multiple inheritance, virtual base classes, and RTTI
Techniques
Item 25: Virtualizing constructors and non-member functions
Item 26: Limiting the number of objects of a class
Item 27: Requiring or prohibiting heap-based objects
Item 28: Smart pointers
Item 29: Reference counting
Item 30: Proxy classes
Item 31: Making functions virtual with respect to more than one object
Miscellany
Item 32: Program in the future tense
Item 33: Make non-leaf classes abstract
Item 34: Understand how to combine C++ and C in the same program
Item 35: Familiarize yourself with the language standard
Recommended Reading
An
auto_ptrImplementationGeneral Index
Index of Example Classes, Functions, and Templates
-
Review:More Effective C++
SEGV, another of our resident book reviewers has written a review of the new Scott Meyer's book More Effective C++: 35 New Ways to Improve Your Programs and Designs. This is a follow-up to his previous book, and is designed for people familiar with the language.
On a different note, if you are interested in reviewing, drop me a line. We need more reviews, and I even have some books to send out as tank oos. More Effective C++: 35 New Ways to Improve Your Programs and Designs author Scott Meyers pages publisher Addison-Wesley rating 8/10 reviewer SEGV ISBN 0-201-63371-X summary A fitting follow-up to a practical classic.More Effective C++: 35 New Ways to Improve Your Programs and Designs,
by Scott Meyers
[Addison-Wesley, ISBN 0-201-63371-X]
Nutshell
Review:A fitting follow-up to a practical classic.
Rating: 8/10
Episode VI: Return of the Guru
Scott Meyers has penned a worthy sequel to his original classic (now in its second edition, reviewed here). More Effecive C++ [online site] continues with the same style and quality, allowing the aspiring C++ student to further her skills with this powerful language.
Scope
This book pretty much assumes that you're familiar with the foundation laid in its predecessor. Because of that, it is able to skip the "basics" (like "use delete on pointer members") and get into more advanced topics.
Although it covers fewer Items, it is a larger book by quite a bit. Some Items are full (20+ pages) treatments of complex subjects, such as implementing smart pointers. Meyers takes you through all the nitty-gritty details of the topic at hand; by the time you're finished an Item, you not only know one or two Right Ways to do something, but also half a dozen Wrong Ways!
Content
After a brief treatment of a few more "basic" Items, Meyers leaps into a discussion of operators. Here he covers some points not present in the first book.
If you are using exceptions at all, the next Items will go far towards justifying the cost of this book. We hear about thread-safety, but often forget about exception-safety. Typically, the latter causes resource leaks, which are not as visible as the crashes caused by the former. Meyers not only explains the finer details of using exceptions properly, he also demonstrates idioms to make cleaning up after your code's mess easy and automatic.
Next Meyers discusses ways to help your code perform better and faster. Some are specific, lower level techniques, such as organizing your functions to facilitate the return value optimization. Others are generic, higher level techniques such as lazy evaluation, but it's valuable to see them illustrated in C++. All give you a deeper understanding of how C++ goes about its business.
The next Items are a set of techniques that you can apply in C++. These idioms may help you solve particular problems: for example, making functions virtual with respect to more than one object is how the Visitor pattern is implemented in C++. Even if you use existing code, such as
auto_ptr, it's enlightening and instructive to see exactly what's going on under the hood, as with smart pointers.Finally, Meyers wraps up his treatise with some more general Items. I particularly like his idea of programming in the future tense. What he really means, is write code as it should be, not just as the compiler allows. If your design calls for constraints, enforce them in the code. Don't break encapsulation just for convenience. Build in flexibility. And so on.
Summary
I recommend this book. It's not as reference-worthy as its predecessor, but it has its own place on your bookshelf. It bears reading even if you borrow a copy.
Buy this book over this way.
TABLE OF CONTENTS
Acknowledgements
Introduction
Basics
Item 1: Distinguish between pointers and references
Item 2: Prefer C++-style casts
Item 3: Never treat arrays polymorphically
Item 4: Avoid gratuitous default constructors
Operators
Item 5: Be wary of user-defined conversion functions
Item 6: Distinguish between prefix and postfix forms of increment and decrement operators
Item 7: Never overload&&,||, or,
Item 8: Understand the different meanings ofnewanddelete
Exceptions
Item 9: Use destructors to prevent resource leaks
Item 10: Prevent resource leaks in constructors
Item 11: Prevent exceptions from leaving destructors
Item 12: Understand how throwing an exception differs from passing a parameter or calling a virtual function
Item 13: Catch exceptions by reference
Item 14: Use exception specifications judiciously
Item 15: Understand the costs of exception handling
Efficiency
Item 16: Remember the 80-20 rule
Item 17: Consider using lazy evaluation
Item 18: Amortize the cost of expected computations
Item 19: Understand the origin of temporary objects
Item 20: Facilitate the return value optimization
Item 21: Overload to avoid implicit type conversions
Item 22: Consider using op= instead of stand-alone op
Item 23: Consider alternative libraries
Item 24: Understand the costs of virtual functions, multiple inheritance, virtual base classes, and RTTI
Techniques
Item 25: Virtualizing constructors and non-member functions
Item 26: Limiting the number of objects of a class
Item 27: Requiring or prohibiting heap-based objects
Item 28: Smart pointers
Item 29: Reference counting
Item 30: Proxy classes
Item 31: Making functions virtual with respect to more than one object
Miscellany
Item 32: Program in the future tense
Item 33: Make non-leaf classes abstract
Item 34: Understand how to combine C++ and C in the same program
Item 35: Familiarize yourself with the language standard
Recommended Reading
An
auto_ptrImplementationGeneral Index
Index of Example Classes, Functions, and Templates
-
Review:UML Distilled
SEGV has submitted a review of UML Distilled: Applying the Standard Object Modeling Language, the first book by Addison-Wesley that is UML Specific in their Object Technology Series. If you're interested in knowing more about the Uniform Modeling Language, click below. UML Distilled: Applying the Standard Object Modeling Language author Martin Fowler with Kendall Scott pages publisher Addison-Wesley rating 9/10 reviewer SEGV ISBN 0-201-32563-2 summary A short and to the point introduction to the standard object modeling language.UML Distilled: Applying the Standard Object Modeling Language,
by Martin Fowler with Kendall Scott
[Addison-Wesley, ISBN 0-201-32563-2]reviewed by SEGV
Nutshell
Review:A short and to the point introduction to the standard object modeling language.
Rating: 9/10
What is the UML?
A modeling language is a (mainly graphical) notation for expressing software designs. Over the last decade, many object-oriented analysis and design gurus developed their own modeling languages and techniques for using them. The two most successful were the Booch method and OMT (Object Modeling Technique). Over the last few years, three of the top gurus (Grady Booch, Jim Rumbaugh, and Ivar Jacobson, now known as the "three amigos") joined forces and unified their methods; hence, the Unified Modeling Language.
The result of that union was the company Rational Software, which developed UML versions 1.0 and 1.1. Now, the OMG (Object Management Group, purveyors of CORBA) is in the process of adopting the UML as standard. Be warned: the OMG adopted version 1.1 as their version 1.0, so there is a lamentable discrepancy in the version numbers.
About the Book
UML Distilled is the first UML-specific book in Addison-Wesley's Object Technology Series (the three amigos are the series editors). The book's online site contains some sample chapters and supplementary information. Martin Fowler's home page also contains useful information.
I have the sixth printing, which is updated to cover UML version 1.0 (per OMG). If you get this book, be sure to get this printing or later.
100% Distilled
UML Distilled is one of the shortest computer books I own: the chapters themselves comprise only 166 pages. It is really only an introduction and overview of the UML and its application; three forthcoming books by the three amigos will go into greater depth. However, the book's brevity is its strength: it is very easily read, and can be consumed in a good afternoon.
Applying the UML
Fowler cuts straight to the chase. In the second chapter he outlines a bare bones development process suitable for use with the UML. In subsequent chapters he covers different parts of the UML, explaining notation, semantics, tips, and techniques. The final chapter is the piece de resistance: an extended example taking the reader from a UML design to Java code.
Throughout UML Distilled, Fowler is not afraid to tell you how he uses the modeling language himself. He will tell you which parts of it he finds extremely useful, and which parts he doesn't bother with. He'll even tell you where he is inclined to bend the rules slightly and do something that strictly speaking doesn't conform to the standard. That's okay, since the desired result is to have the modeling language be of use to you.
Diagrams
As the table of contents shows, most of the chapters cover a particular type of diagram in the UML. If you've never object modeling diagrams, you should check out the book's inside covers, which give a feel for their various elements (and serve as an excellent reference).
I find the class diagrams, interaction diagrams, and activity diagrams to be of most use to me. The first kind is absolutely essential for documenting the structure of your classes. The second kind is useful for documenting how the various classes interact with each other. The third kind is useful for documenting the steps in a task. The latter two kinds even allow for concurrency! And of course, they are all meant to be used during the design phase, and not merely for documentation after the implementation phase (often a sad reality).
Software
I typically do object modeling with a stack of large sheets of blank paper, or a whiteboard. But software tools do exist, whether they are more of a drawing tool or actually generate code. Rational Rose is one of the better known and most advanced tools. However, the software is typically quite expensive. I'm not aware of any freely available alternatives.
Design Patterns
It is worth noting that Fowler is also the author of Analysis Patterns (online site), a book of design patterns for business domain modeling. If you're a patterns fan, you'll be happy to note that there are several examples of their usage in UML Distilled.
Summary
UML Distilled is suitable for all levels. It is short and to the point, and offers an excellent introduction to the field of object modeling. Fowler offers good advice where he is qualified, and points the reader elsewhere (other books or web sites) where his knowledge or experience is lacking, or where further information is available. I recommend this book, at least until the "canon" UML books are available!
TABLE OF CONTENTS
- Introduction
- An Outline Development Process
- Use Cases
- Class Diagrams: The Essentials
- Class Diagrams: Advanced Concepts
- Interaction Diagrams
- Package Diagrams
- State Diagrams
- Activity Diagrams
- Deployment Diagrams
- UML and Programming
- Techniques and Their Uses
- Changes From UML 1.0 to 1.1
- Bibliography
- Index
-
Review:UML Distilled
SEGV has submitted a review of UML Distilled: Applying the Standard Object Modeling Language, the first book by Addison-Wesley that is UML Specific in their Object Technology Series. If you're interested in knowing more about the Uniform Modeling Language, click below. UML Distilled: Applying the Standard Object Modeling Language author Martin Fowler with Kendall Scott pages publisher Addison-Wesley rating 9/10 reviewer SEGV ISBN 0-201-32563-2 summary A short and to the point introduction to the standard object modeling language.UML Distilled: Applying the Standard Object Modeling Language,
by Martin Fowler with Kendall Scott
[Addison-Wesley, ISBN 0-201-32563-2]reviewed by SEGV
Nutshell
Review:A short and to the point introduction to the standard object modeling language.
Rating: 9/10
What is the UML?
A modeling language is a (mainly graphical) notation for expressing software designs. Over the last decade, many object-oriented analysis and design gurus developed their own modeling languages and techniques for using them. The two most successful were the Booch method and OMT (Object Modeling Technique). Over the last few years, three of the top gurus (Grady Booch, Jim Rumbaugh, and Ivar Jacobson, now known as the "three amigos") joined forces and unified their methods; hence, the Unified Modeling Language.
The result of that union was the company Rational Software, which developed UML versions 1.0 and 1.1. Now, the OMG (Object Management Group, purveyors of CORBA) is in the process of adopting the UML as standard. Be warned: the OMG adopted version 1.1 as their version 1.0, so there is a lamentable discrepancy in the version numbers.
About the Book
UML Distilled is the first UML-specific book in Addison-Wesley's Object Technology Series (the three amigos are the series editors). The book's online site contains some sample chapters and supplementary information. Martin Fowler's home page also contains useful information.
I have the sixth printing, which is updated to cover UML version 1.0 (per OMG). If you get this book, be sure to get this printing or later.
100% Distilled
UML Distilled is one of the shortest computer books I own: the chapters themselves comprise only 166 pages. It is really only an introduction and overview of the UML and its application; three forthcoming books by the three amigos will go into greater depth. However, the book's brevity is its strength: it is very easily read, and can be consumed in a good afternoon.
Applying the UML
Fowler cuts straight to the chase. In the second chapter he outlines a bare bones development process suitable for use with the UML. In subsequent chapters he covers different parts of the UML, explaining notation, semantics, tips, and techniques. The final chapter is the piece de resistance: an extended example taking the reader from a UML design to Java code.
Throughout UML Distilled, Fowler is not afraid to tell you how he uses the modeling language himself. He will tell you which parts of it he finds extremely useful, and which parts he doesn't bother with. He'll even tell you where he is inclined to bend the rules slightly and do something that strictly speaking doesn't conform to the standard. That's okay, since the desired result is to have the modeling language be of use to you.
Diagrams
As the table of contents shows, most of the chapters cover a particular type of diagram in the UML. If you've never object modeling diagrams, you should check out the book's inside covers, which give a feel for their various elements (and serve as an excellent reference).
I find the class diagrams, interaction diagrams, and activity diagrams to be of most use to me. The first kind is absolutely essential for documenting the structure of your classes. The second kind is useful for documenting how the various classes interact with each other. The third kind is useful for documenting the steps in a task. The latter two kinds even allow for concurrency! And of course, they are all meant to be used during the design phase, and not merely for documentation after the implementation phase (often a sad reality).
Software
I typically do object modeling with a stack of large sheets of blank paper, or a whiteboard. But software tools do exist, whether they are more of a drawing tool or actually generate code. Rational Rose is one of the better known and most advanced tools. However, the software is typically quite expensive. I'm not aware of any freely available alternatives.
Design Patterns
It is worth noting that Fowler is also the author of Analysis Patterns (online site), a book of design patterns for business domain modeling. If you're a patterns fan, you'll be happy to note that there are several examples of their usage in UML Distilled.
Summary
UML Distilled is suitable for all levels. It is short and to the point, and offers an excellent introduction to the field of object modeling. Fowler offers good advice where he is qualified, and points the reader elsewhere (other books or web sites) where his knowledge or experience is lacking, or where further information is available. I recommend this book, at least until the "canon" UML books are available!
TABLE OF CONTENTS
- Introduction
- An Outline Development Process
- Use Cases
- Class Diagrams: The Essentials
- Class Diagrams: Advanced Concepts
- Interaction Diagrams
- Package Diagrams
- State Diagrams
- Activity Diagrams
- Deployment Diagrams
- UML and Programming
- Techniques and Their Uses
- Changes From UML 1.0 to 1.1
- Bibliography
- Index
-
Review: Effective C++
Loyal reader SEGV has written a review of Effective C++, the language we all know and love. A good book for people who have a grasp of the language and looking to deepen their knowledge. Click below to read more.This also is my first book review for Slashdot, and I also have "reused" Rick Franchuk's review layout. The text, however, is mine: warts and all.
Effective C++: Second Edition Scott Meyers (Addison Wesley Longman, Inc. ISBN: 0-201-92488-9)Nutshell Review Up to date revision of a classic book, highly applicable to real-world software development. Not a language reference or primer, but rather a series of essays on the trickier points of C++, how they can cause you grief, and how you can harness their power. Intermediate level, yet easily read.
Rating 10/10
review by SEGV
I've just finished reading the second edition of Effective C++, subtitled "50 Specific Ways to Improve Your Programs and Designs." I really should have read it a year or two ago, as was wisely recommended to me. In that time I've had to debug (others') code that illustrated several Items in this book, and it truly would have helped me then to fully understand what was going on.
What this->book Isn't, and IsThis book doesn't teach the C++ language. It isn't suitable as a reference, or as an introduction to the language. You are expected to know the basics of C and C++: what a class is, what inheritance does, and so on. Rather, this book aims to teach you how to use the language, effectively. It does so by presenting 50 Items, each of which is a simple guideline with several pages of explanatory text. [Check out Item titles in the table of contents below.]
Meyers supports each guideline with illustrative examples and lucid code. He clearly describes what is going on, where you (or others) might get tripped up, and why that is so. Practical man that he is, he even provides you with the safest way to bend the guidelines, for those rare times when you must. And he does all of this in a humourous style!
A Prayer Book for DevelopersThe Items don't state "Thou shall" or "Thou shalt not." All the same, this book can be read like a Bible. Perhaps read an item per sitting. Or skip to one that interests you (or is relevant to what you are currently coding). Submit an Item to serious study. Memorize the Items' prescriptions, philosophize over their inner meaning. And punish yourself if you sin.
Really, before a developer starts writing his own
operator newhe will want to read the Items on memory management in C++. There are a few gotchas there. In fact, read those Items before you even callnew!If you don't, you will surely end up in programmer's hell.
Standard C++This book pretty much covers Standard C++, having been recently revised. In many cases Meyers shows why the new language features are superior to the old way (either C or pre-standard C++). Still, he is careful to show alternative implementations in areas where compilers are not yet up to spec. Although he provides an overview of the standard library and encourages its use everywhere, you'll need another reference to learn it. But you knew that already.
Anecdotal EvidenceI don't fondly remember the few days I spent debugging a particular memory related crash. In the end I discovered that the author of a "smart" pointer class had failed to provide a copy constructor. As it happened, his compiler had optimized out some temporary objects, and so did two of mine. But a fourth compiler created temporaries, and without the copy constructor a reference count was off. As the object was passed back up the call chain as return values, it was
deleted out from under itself. Nasty.Meyers brings up all these issues, and explains them better than I, in Items 11, 27, and 45. Following his guidelines, a copy constructor would have been written either as a matter of course, or made unavailable to users of the class. This bug could have been prevented.
I now keep a printout of the Item titles on the wall by my desk.
Recommendation: Learn it, Love it, Live itBuy this book and take it to heart. Your co-developers will love you for it, or just not kill you, depending on their disposition. I'm assuming you are a developer, but if not, this book is suitable for any intermediate student of the C++ language. Language features are explained as they are used, just not in an exhaustive fashion. Rather, they are brought to bear when the design issue they are applicable to is being discussed.
Keep it handy, right between your introductory C++ book and Bjarne Stroustrup's The C++ Programming Language. You'll use it.
Online SupportThe publisher hosts a web page to support the book: http://www.aw.com/cseng/titles/0-201-92488-9/. It contains the full text of the TOC, Preface, and Items 10, 21, 24, and 32. It also contains updates and errata, in case you're unlucky like me and have an earlier (second) printing. [I was hoping to get into the acknowledgements when I found a genuine error, but it has been fixed in the fourth (current) printing. Doh!]
More Effective C++If you're like me and craving more, Meyers has it covered. I'm currently reading More Effective C++, subtitled "35 New Ways to Improve Your Programs and Designs." Again, the supporting web page at http://www.aw.com/cseng/titles/0-201-63371-X/ has available the full text of several Items, and also an
auto_ptrimplementation in case you're curious how a "smart" pointer works. A great candidate for another review. :-)Check this book out over at Amazon.
Table of ContentsPreface
Acknowledgements
Introduction
Shifting from C to C++
Item 1: Preferconstandinlineto#define.
Item 2: Prefer to .
Item 3: Prefernewanddeletetomallocandfree.
Item 4: Prefer C++-style comments.
Memory Management
Item 5: Use the same form in corresponding uses ofnewanddelete.
Item 6: Usedeleteon pointer members in destructors.
Item 7: Be prepared for out-of-memory conditions.
Item 8: Adhere to convention when writingoperator newandoperator delete.
Item 9: Avoid hiding the "normal" form ofnew.
Item 10: Writeoperator deleteif you writeoperator new.
Constructors, Destructors, and Assignment Operators
Item 11: Declare a copy constructor and an assignment operator for classes with dynamically allocated memory.
Item 12: Prefer initialization to assignment in constructors.
Item 13: List members in an initialization list in the order in which they are declared.
Item 14: Make destructors virtual in base classes.
Item 15: Haveoperator=return a reference to*this.
Item 16: Assign to all data members inoperator=.
Item 17: Check for assignment to self inoperator=.
Classes and Functions: Design and Declaration
Item 18: Strive for class interfaces that are complete and minimal.
Item 19: Differentiate among member functions, non-member functions, and friend functions.
Item 20: Avoid data members in the public interface.
Item 21: Useconstwhenever possible.
Item 22: Prefer pass-by-reference to pass-by-value.
Item 23: Don't try to return a reference when you must return an object.
Item 24: Choose carefully between function overloading and parameter defaulting.
Item 25: Avoid overloading on a pointer and a numerical type.
Item 26: Guard against potential ambiguity.
Item 27: Explicitly disallow use of implicitly generated member functions you don't want.
Item 28: Partition the global namespace.
Classes and Functions: Implementation
Item 29: Avoid returning "handles" to internal data.
Item 30: Avoid member functions that return non-constpointers or references to members less accessible than themselves.
Item 31: Never return a reference to a local object or to a dereferenced pointer initialized bynewwithin the function.
Item 32: Postpone variable definitions as long as possible.
Item 33: Use inlining judiciously.
Item 34: Minimize compilation dependencies between files.
Inheritance and Object-Oriented Design
Item 35: Make sure public inheritance models "isa."
Item 36: Differentiate between inheritance of interface and inheritance of implementation.
Item 37: Never redefine an inherited nonvirtual function.
Item 38: Never redefine an inherited default parameter value.
Item 39: Avoid casts down the inheritance hierarchy.
Item 40: Model "has-a" or "is-implemented-in-terms-of" through layering.
Item 41: Differentiate between inheritance and templates.
Item 42: Use private inheritance judiciously.
Item 43: Use multiple inheritance judiciously.
Item 44: Say what you mean; understand what you're saying.
Miscellany
Item 45: Know what functions C++ silently writes and calls.
Item 46: Prefer compile-time and link-time errors to runtime errors.
Item 47: Ensure that non-local static objects are initialized before they're used.
Item 48: Pay attention to compiler warnings.
Item 49: Familiarize yourself with the standard library.
Item 50: Improve your understanding of C++.
Afterward
Index
-
Review: Effective C++
Loyal reader SEGV has written a review of Effective C++, the language we all know and love. A good book for people who have a grasp of the language and looking to deepen their knowledge. Click below to read more.This also is my first book review for Slashdot, and I also have "reused" Rick Franchuk's review layout. The text, however, is mine: warts and all.
Effective C++: Second Edition Scott Meyers (Addison Wesley Longman, Inc. ISBN: 0-201-92488-9)Nutshell Review Up to date revision of a classic book, highly applicable to real-world software development. Not a language reference or primer, but rather a series of essays on the trickier points of C++, how they can cause you grief, and how you can harness their power. Intermediate level, yet easily read.
Rating 10/10
review by SEGV
I've just finished reading the second edition of Effective C++, subtitled "50 Specific Ways to Improve Your Programs and Designs." I really should have read it a year or two ago, as was wisely recommended to me. In that time I've had to debug (others') code that illustrated several Items in this book, and it truly would have helped me then to fully understand what was going on.
What this->book Isn't, and IsThis book doesn't teach the C++ language. It isn't suitable as a reference, or as an introduction to the language. You are expected to know the basics of C and C++: what a class is, what inheritance does, and so on. Rather, this book aims to teach you how to use the language, effectively. It does so by presenting 50 Items, each of which is a simple guideline with several pages of explanatory text. [Check out Item titles in the table of contents below.]
Meyers supports each guideline with illustrative examples and lucid code. He clearly describes what is going on, where you (or others) might get tripped up, and why that is so. Practical man that he is, he even provides you with the safest way to bend the guidelines, for those rare times when you must. And he does all of this in a humourous style!
A Prayer Book for DevelopersThe Items don't state "Thou shall" or "Thou shalt not." All the same, this book can be read like a Bible. Perhaps read an item per sitting. Or skip to one that interests you (or is relevant to what you are currently coding). Submit an Item to serious study. Memorize the Items' prescriptions, philosophize over their inner meaning. And punish yourself if you sin.
Really, before a developer starts writing his own
operator newhe will want to read the Items on memory management in C++. There are a few gotchas there. In fact, read those Items before you even callnew!If you don't, you will surely end up in programmer's hell.
Standard C++This book pretty much covers Standard C++, having been recently revised. In many cases Meyers shows why the new language features are superior to the old way (either C or pre-standard C++). Still, he is careful to show alternative implementations in areas where compilers are not yet up to spec. Although he provides an overview of the standard library and encourages its use everywhere, you'll need another reference to learn it. But you knew that already.
Anecdotal EvidenceI don't fondly remember the few days I spent debugging a particular memory related crash. In the end I discovered that the author of a "smart" pointer class had failed to provide a copy constructor. As it happened, his compiler had optimized out some temporary objects, and so did two of mine. But a fourth compiler created temporaries, and without the copy constructor a reference count was off. As the object was passed back up the call chain as return values, it was
deleted out from under itself. Nasty.Meyers brings up all these issues, and explains them better than I, in Items 11, 27, and 45. Following his guidelines, a copy constructor would have been written either as a matter of course, or made unavailable to users of the class. This bug could have been prevented.
I now keep a printout of the Item titles on the wall by my desk.
Recommendation: Learn it, Love it, Live itBuy this book and take it to heart. Your co-developers will love you for it, or just not kill you, depending on their disposition. I'm assuming you are a developer, but if not, this book is suitable for any intermediate student of the C++ language. Language features are explained as they are used, just not in an exhaustive fashion. Rather, they are brought to bear when the design issue they are applicable to is being discussed.
Keep it handy, right between your introductory C++ book and Bjarne Stroustrup's The C++ Programming Language. You'll use it.
Online SupportThe publisher hosts a web page to support the book: http://www.aw.com/cseng/titles/0-201-92488-9/. It contains the full text of the TOC, Preface, and Items 10, 21, 24, and 32. It also contains updates and errata, in case you're unlucky like me and have an earlier (second) printing. [I was hoping to get into the acknowledgements when I found a genuine error, but it has been fixed in the fourth (current) printing. Doh!]
More Effective C++If you're like me and craving more, Meyers has it covered. I'm currently reading More Effective C++, subtitled "35 New Ways to Improve Your Programs and Designs." Again, the supporting web page at http://www.aw.com/cseng/titles/0-201-63371-X/ has available the full text of several Items, and also an
auto_ptrimplementation in case you're curious how a "smart" pointer works. A great candidate for another review. :-)Check this book out over at Amazon.
Table of ContentsPreface
Acknowledgements
Introduction
Shifting from C to C++
Item 1: Preferconstandinlineto#define.
Item 2: Prefer to .
Item 3: Prefernewanddeletetomallocandfree.
Item 4: Prefer C++-style comments.
Memory Management
Item 5: Use the same form in corresponding uses ofnewanddelete.
Item 6: Usedeleteon pointer members in destructors.
Item 7: Be prepared for out-of-memory conditions.
Item 8: Adhere to convention when writingoperator newandoperator delete.
Item 9: Avoid hiding the "normal" form ofnew.
Item 10: Writeoperator deleteif you writeoperator new.
Constructors, Destructors, and Assignment Operators
Item 11: Declare a copy constructor and an assignment operator for classes with dynamically allocated memory.
Item 12: Prefer initialization to assignment in constructors.
Item 13: List members in an initialization list in the order in which they are declared.
Item 14: Make destructors virtual in base classes.
Item 15: Haveoperator=return a reference to*this.
Item 16: Assign to all data members inoperator=.
Item 17: Check for assignment to self inoperator=.
Classes and Functions: Design and Declaration
Item 18: Strive for class interfaces that are complete and minimal.
Item 19: Differentiate among member functions, non-member functions, and friend functions.
Item 20: Avoid data members in the public interface.
Item 21: Useconstwhenever possible.
Item 22: Prefer pass-by-reference to pass-by-value.
Item 23: Don't try to return a reference when you must return an object.
Item 24: Choose carefully between function overloading and parameter defaulting.
Item 25: Avoid overloading on a pointer and a numerical type.
Item 26: Guard against potential ambiguity.
Item 27: Explicitly disallow use of implicitly generated member functions you don't want.
Item 28: Partition the global namespace.
Classes and Functions: Implementation
Item 29: Avoid returning "handles" to internal data.
Item 30: Avoid member functions that return non-constpointers or references to members less accessible than themselves.
Item 31: Never return a reference to a local object or to a dereferenced pointer initialized bynewwithin the function.
Item 32: Postpone variable definitions as long as possible.
Item 33: Use inlining judiciously.
Item 34: Minimize compilation dependencies between files.
Inheritance and Object-Oriented Design
Item 35: Make sure public inheritance models "isa."
Item 36: Differentiate between inheritance of interface and inheritance of implementation.
Item 37: Never redefine an inherited nonvirtual function.
Item 38: Never redefine an inherited default parameter value.
Item 39: Avoid casts down the inheritance hierarchy.
Item 40: Model "has-a" or "is-implemented-in-terms-of" through layering.
Item 41: Differentiate between inheritance and templates.
Item 42: Use private inheritance judiciously.
Item 43: Use multiple inheritance judiciously.
Item 44: Say what you mean; understand what you're saying.
Miscellany
Item 45: Know what functions C++ silently writes and calls.
Item 46: Prefer compile-time and link-time errors to runtime errors.
Item 47: Ensure that non-local static objects are initialized before they're used.
Item 48: Pay attention to compiler warnings.
Item 49: Familiarize yourself with the standard library.
Item 50: Improve your understanding of C++.
Afterward
Index