What We've LearnedIn this chapter on the Double Descent bug pattern, we've learned the following:
In short, the moral to this story is to always convince yourself that the invariants inside a code block ensure that any casts in the block will always succeed. When each cast is held to this level of scrutiny, you may find yourself eliminating many of these casts by adding methods to the relevant subclasses. In Chapter 12, we'll discuss the Liar View bug, a pattern that often occurs in GUI applications. |