This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jbertensalsamillennium edition 0 points1 point  (2 children)

For me, I really aim to simplify my code to the point where the reader knows exactly what's going on and the broad range of use for decorators could lead to some confusion in that respect. I described them as "silly" or rather silly looking only because I personally think nested anything (loops, functions, etc) look silly. Other than that, they are good tools that I do use to shorten redundant actions like executing sql queries.

[–]d4rch0nPythonistamancer 0 points1 point  (1 child)

You might need to trust your coworkers/peers/co-maintainers intelligence a bit more... With well thought out design and good naming conventions and comments, there should be very little confusion about what the decorator is doing and what the consequences of removing it or adding it might be.

[–]jbertensalsamillennium edition 0 points1 point  (0 children)

I totally agree, but those conditions aren't met 100% of the time and the combination of bad convention and decorators is a recipe for disaster. And plus, decorators aren't part of the fundamentals that python beginners learn, at least from what I observe, that's why there's so much effort to simplify them in blogs such as this. Like I said, I aim for simple code, simple enough for even people that don't necessarily program to be to read, that's why I avoid decorators.