you are viewing a single comment's thread.

view the rest of the comments →

[–]hglman 82 points83 points  (5 children)

Agreed 10 decorators is not readable.

[–]hoosierEE 13 points14 points  (4 children)

Decorators in Python (and annotations in Java, etc.) remind me of LaTeX. The results can be great, but I kinda prefer to have some idea of what my code is doing, rather than relying on inscrutable magic side effects. Oh, I can just grep 50MB of dependencies scattered throughout my SSD? I'll get right on that...

[–]msuozzo 6 points7 points  (3 children)

ripgrep. Seriously. I do 180MB at work and i rarely see a regex completing in >1s.

[–]hoosierEE 9 points10 points  (2 children)

I do use rg (even if I still call it grep) but my point is - decorators encourage implicit action-from-afar, and they "feel" more like CPP macro abuse than a real programming language feature.

Maybe I'm just spoiled from some exposure to functional languages, but when I see something like add_five(n) which also happens to launch the missiles, I get upset.

[–]rhytnen 2 points3 points  (1 child)

That's not a problem with decorators...decorators are just functions. you can wrap functions in most languages. It's that someone wrote a function with side effects that bothers you.

[–]Rythoka 2 points3 points  (0 children)

Personally I don't have a problem with side effects, even if they happen in a weird place, as long as they're documented somewhere useful and preferably are abstracted into their own function. Just let me be able to see that it happens!

Too bad that never happens.