Skip to main content
1 of 2
drekka
  • 1.3k
  • 1
  • 9
  • 20

I prefer to employ guard blocks where ever I can for two reasons:

  1. The allow a quick exit given some specific condition.
  2. The remove the necessity for complex and un-necessary if statements later in the code.

Generally speaking I prefer to see methods where the core functionality of the method is clear and minimal. Guard blocks help to visual make this happen.

drekka
  • 1.3k
  • 1
  • 9
  • 20