I love this advice, moving if statements "up" is something I've observed makes a big difference between code that's fun to work with and easy to maintain, and code that quickly gets unmaintainable. I'm sure everyone's familiar with the function that takes N different boolean flags to control different parts of the behavior.
I think it really comes down to: functions that have fewer if statements tend to be doing less, and are therefore more reusable.
I think it really comes down to: functions that have fewer if statements tend to be doing less, and are therefore more reusable.