2 ms·
This particular use of an if statement is subset of what's called a "guard clause", and I'm also a major fan of them. Other guards include an early return for
by Izkata 6y ago
This particular use of an if statement is subset of what's called a "guard clause", and I'm also a major fan of them. Other guards include an early return for edge cases or that would make the more general path more complicated, rather than just exceptions.
https://wiki.c2.com/?GuardClause/ https://wiki.c2.com/?GuardClause/