This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Part of the answer states: The assert statement is being used to check a control-flow invariant to verify that the control flow never reaches a point in the program. This doesn't make sense to me since the assert statement is outside of the If statement unless I didn't match up the braces correctly. The assert statement would fire every time regardless of the flow thru the if's. If it had been written
then I could buy into this answer. I'm probably missing something, so I submit myself to those more knowledgable. I haven't found anything else where Dan's code and answers weren't 100% correct, so I'm sure I'm overlooking something, but what?