November 2018
Intermediate to advanced
448 pages
13h 10m
English
Much of the power of programs comes from their ability to implement conditional logic—but, sadly, much of the complexity of programs lies in these conditionals. I often use refactoring to make conditional sections easier to understand. I regularly apply Decompose Conditional (260) to complicated conditionals, and I use Consolidate Conditional Expression (263) to make logical combinations clearer. I use Replace Nested Conditional with Guard Clauses (266) to clarify cases where I want to run some pre-checks before my main processing. If I see several conditions using the same switching logic, it’s a good time to pull Replace Conditional with Polymorphism (272) out the box.
A lot of conditionals are used ...
Read now
Unlock full access