4 Matching Annotations
- Jan 2022
Boilerplate is only boilerplate if it's the same everywhere, which it shouldn't be.
- Feb 2021
Not all cases can be covered and easily restored. And sometimes when we will reuse this function for different use-cases we will find out that it requires different restore logic.
But why do we return 0? Why not 1? Why not None? And while None in most cases is as bad (or even worse) than the exceptions, turns out we should heavily rely on business logic and use-cases of this function.
So, the sad conclusion is: all problems must be resolved individually depending on a specific usage context. There’s no silver bullet to resolve all ZeroDivisionErrors once and for all. And again, I am not even covering complex IO flows with retry policies and expotential timeouts.
- the specific context is important
- actually consider / think about how it _should_ (ideally) be
- need to solve specific case/problems individually (there is no general solution)
- error/exception handling
- sad/unfortunate conclusion
- depends on use case / application