3 ms·
A big problem with many of these features is that they almost always end up getting used in ways that makes the code more convoluted when there are simpler alte
by omegalulw 5y ago
A big problem with many of these features is that they almost always end up getting used in ways that makes the code more convoluted when there are simpler alternatives.
needing to store state - use a class
needing lazy evalutaion - use a class (though this is a common enough use case to be a primitive, e.g. Kotlin)
decorators - if you pass decorated methods around -> now you have to remember the context the methods hold. Instead, refactor your code to be more direct so that you don't need decorators.
type hints - they are not fully enforceable at compile time, unless everything in your codebase has type hints. This is never the case and type hints can easily lull you into a false sense of security.
functools module - generally I'm ok with this but sonetimes you have to be aware of when you need to deep copy vs when you don't etc.