Decorators: an outsider's perspective

John Keeling johnfkeeling at yahoo.com
Sun Aug 15 06:32:08 CEST 2004


Chas,
> action-at-a-distance is *always* bad.

I agree, but the culprit is the poor style of writing a
function/method implementation that spreads over numerous pages. If a
function is large, it is good style to break it up.
So, to my mind, the action-at-a-distance problem doesn't really exist
... it is just poor coding style of very large functions that creates
action-at-a-distance here:

> def blah (args):
> ....[insert 50/100/200 lines here]
> blah = staticmethod(blah)

I say, if function/method blah is over a page long, then it should be
broken up into smaller component functions, thus removing the
action-at-a-distance complaint.
So, with due respect for all honourable python devs who have given us
IMO the best programming language available, decorators, to my mind,
are a totally superfluous feature ... and this turns out to be a
negative because they are unnecessary (and divisive).
My opinion: please remove decorators forever, or at least until there
is some concensus as to how they should be used.
John



More information about the Python-list mailing list