guard clause

Why you should avoid conditional statements

Developers tend to use a lot of conditional statements in their code. Of course, each flow has one specific path, its own specific validations, etc. It is very natural that your code has a lot of decisions to be made at runtime, but, mostly, when you use a lot of conditional statements in specific area of your code, probably you are not using it right. Conditional statements should be used for small decisions, not big decisions, not for choosing one path of five others. (It really hurts to see chained…

Keep reading