3 ms·
Agreed. The decorator idea didn't just come out of nowhere: It merely codified a convention that appeared in a lot of code where `function` would be defined and
by shadytrees 18y ago
Agreed. The decorator idea didn't just come out of nowhere: It merely codified a convention that appeared in a lot of code where `function` would be defined and then you'd see `function = decorate(function)` afterward. (This is, for example, arguably the core idea of WSGI.)
- ajross 18y agoRight. So ... why bother with adding a feature to the language when the language as it already exists can do it in one easily-comprehended line of six tokens? I'm sure you like the shorter syntax better. But I didn't know it, despite years of experience with scripting languages (and even this paradigm) that should have informed me about what that code means. But it didn't, for the simple reason that it looked funny because I haven't been keeping up with Python. I'll say it one last time: this idea, that the language should cater to its experts by adding features wherever possible, is what has killed C++ as a hacker's language. Python is walking blindly down the same path.
- natrius 18y ago"So ... why bother with adding a feature to the language when the language as it already exists can do it in one easily-comprehended line of six tokens?" The decorator syntax is easier to read. It's at the top of the function where the arguments list and docstring are. Yes, there are tradeoffs when introducing new syntax, but decorators are definitely worth it.
- schtog 18y agois it? python3000 has deleted some unnecessary stuff. i dont really see your concern. it seems gvr is still concerned about the opposite of what you claim.