Thing is... not always a guarding clause is better than a block in an if, because of readability reasons. For example, the QA will declare this is a QA problem:
notice that I am not against guarding clauses, I like them... is just that you cannot use them all the time. In particular I often call them "escape clauses", because I put them to "escape" a method at the beginning.
Thing is... not always a guarding clause is better than a block in an if, because of readability reasons. For example, the QA will declare this is a QA problem:
but in fact, I disagree with that rule, because this is clearly more readable than:
notice that I am not against guarding clauses, I like them... is just that you cannot use them all the time. In particular I often call them "escape clauses", because I put them to "escape" a method at the beginning.