2 ms·
Yes, I love guard clauses! I work in Python, and one thing I do if I end up needing to use the same guard clause in several functions is to turn it into a deco
by amyjess 9y ago
Yes, I love guard clauses!
I work in Python, and one thing I do if I end up needing to use the same guard clause in several functions is to turn it into a decorator. That way, if I need to update the logic, I can do it in one place and have it propagate everywhere and it makes the function's dependencies clear at first glance.
This was my introduction to aspect-oriented programming, which I've thoroughly fallen in love with.