Goke Pelemo

64%
Flag icon
I often see people encourage using assertions in order to find errors. While this is certainly a Good Thing, it’s not the only reason to use them. I find assertions to be a valuable form of communication—they tell the reader something about the assumed state of the program at this point of execution. I also find them handy for debugging, and their communication value means I’m inclined to leave them in once I’ve fixed the error I’m chasing. Self-testing code reduces their value for debugging, as steadily narrowing unit tests often do the job better, but I still like assertions for ...more
Refactoring: Improving the Design of Existing Code (Addison-Wesley Signature Series (Fowler))
Rate this book
Clear rating
Open Preview