Tip 19: Maximize Efficiency with Short Circuiting
You’ve been simplifying conditional expressions a lot in the last few tips. But there’s one more level of simplification you can use: short circuiting.
As the name implies, the goal of short circuiting is to bypass information checks by placing the most relevant information first.
Example 1: Cleaning ternary code using short circuiting
Consider the following ternary, which would fit in well with the discussion from the previous chapter.