Book cover copyright Martin Fowler
This chapter explains several refactoring methods for simplifying conditional logic.
My One Takeaway
Another two takeaway chapter:
- Decompose Conditional is a huge win for me for readability
- “I often find I use Replace Nested Conditional with Guard Clauses when I’m working with a programmer who has been taught to have only one entry point and one exit point from a method. … Clarity is the key principal: If the method is clearer with one exit point, use one exit point; otherwise don’t.” I love “Clarity is the key principal” and it should be on every blackboard in every programming class ever.
Scott is the Director of Technology at WeCare Connect where he strives to provide solutions for his customers needs. He's the father of two and can be found most weekends working on projects around his house with his loving partner.