<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<link rel="self" href="/Atom/" />
	<id>http://billmill.org/</id>
	<title>My Name Rhymes</title>
	<subtitle>Bill Mill blogs irregularly</subtitle>
	<updated>2004-12-22T18:28:00Z</updated>
	<author>
		<name>Bill Mill</name>
		<email>bill.mill@gmail.com</email>
		<uri>http://billmill.org/</uri>
	</author>
	<link href="http://billmill.org/" />
	<entry>
		<title>Collected Responses to Comments on "The Redecorator"</title>
		<link href="http://billmill.org/redec_response.html" />	
		<id>http://billmill.org/redec_response.html</id>
		<updated>2004-12-22T18:28:00Z</updated>
		<summary type="html">&lt;a href="http://dirtsimple.org/"&gt;Phillip J. Eby&lt;/a&gt; writes:&lt;p&gt;
&lt;blockquote&gt;the issue with his use of decorators (to me anyway) wasn't that he 
used them, but that he had a really silly name for the decorator.  Instead of 
@param, it should've been called something like @call_with or @test_with.
Then, the code would have made more sense when reading.&lt;/blockquote&gt;&lt;p&gt;
While I agree with your point, Phillip, I still feel that there's a greater
issue at hand. I don't think that Ian's use of a decorator to create a testing
function is simpler than the alternative he prevents. Thus, I don't think that
he should use a decorator in that circumstance.&lt;p&gt;
&lt;blockquote&gt;With properly named and documented decorators, it shouldn't be 
necessary to understand their implementation&lt;/blockquote&gt;&lt;p&gt;
I've always had problems with this theory. Know the interface, and assume that
it works by "magic", it says. While that's fine in theory, I find that I am far
less effective when I use a framework or interface and not what goes on behind
it. It may just be that the way I think requires me to understand the
underlying technology in a way that other people don't need to, but I am just
not comfortable using an implementation of something I don't understand.&lt;p&gt;
Obviously, there have to be exceptions, as some things would require an
indordinate amount of effort to understand deeply. While I allow that this is
sometimes true (CPython and wxWindows come to mind), I work hard to increase my
understanding of the underlying technology every time I get a chance to do so.
I find that the more I know about it, the better my code gets, and that I often
get "aha!" moments as I grasp more of the framework.&lt;p&gt;
Furthermore, it seems to me that this statement is less true in Python than in
Java, as Python allows extraordinary simplicity. This is one of the main
reasons why I like the language, and this is one of the reasons I dislike 
extensions to it which encourage complexity.&lt;p&gt;
&lt;a href=http://effbot.org/"&gt;Fredrik&lt;/a&gt; writes:&lt;p&gt;
&lt;blockquote&gt;I'm beginning to realize that the people who are the most 
enthusiastic about things like metaclasses, decorators, 
nested-functions-instead-of-classes, etc. do not think in the same Python as 
I do&lt;/blockquote&gt;&lt;p&gt;
I don't know if I'd state it quite that strongly, but I do see a new trend in
the way that people want to use python. I find myself using nested functions,
but very occasionally, and only in limited circumstances. I mainly find them 
useful in mathematical contexts.&lt;p&gt;
What scares me is what I see as the c++ification (if I may coin a term) of our
language. The community seems content to move towards adding language features
that are useful only to the wizards of the language. This is fine for the
wizards, but it tends to create a second class of programmer. These
second-class programmers, who just want to get things done, understand the 
basics of the language, but simply assume that code which contains metaphors 
they don't understand is unreadable.&lt;p&gt;
I think that metaclasses (which I just assume I don't understand, myself) and
decorators (which required me to waste a lot of time just to understand how
simple they are) are both steps down this road, unfortunately.&lt;p&gt;
&lt;a href="http://apipes.blogspot.com/2004/12/bill-mill-on-decorators.html"&gt;Tim
Lesher&lt;/a&gt; writes on his blog:&lt;p&gt;
&lt;blockquote&gt;My only, weak answer [to "why should I use a metaclass?"] was, "If 
you think you need one, you don't. 
If you know you need one, why are you taking advice from me?"&lt;/blockquote&gt;&lt;p&gt;
That is exactly what I meant to say when I asked people to leave decorators to
the Other People. The set of features that require 
this sort of response is almost exactly equivalent to
the set of features that I don't like.&lt;p&gt;
Finally, &lt;a href="http://bob.pycs.net/"&gt;Bob Ippolito&lt;/a&gt;, who really should
pick &lt;a href="http://pyblosxom.sourceforge.net"&gt;pyblosxom&lt;/a&gt; for his new blog
server (/marketing), writes:
&lt;blockquote&gt;Personally, I think that decorators serve a useful purpose.  There 
are many cases where they save you from spelling out an identifier three times.
Repetition is stupid, and Python doesn't otherwise have a lot of repetition, 
but function transformations need them since functions are statements and not 
expressions.&lt;br&gt;&lt;br&gt;
Maybe I should just use lisp instead.&lt;/blockquote&gt;
&lt;p&gt;In my mind, simplicity is a greater goal of python than is the avoidance of
repetition. GvR has often made it clear that limiting the number of keystrokes
is not one of his guiding factors in desiging the language ("
This is *not* a number-of-keystrokes argument. You know I don't care
much about that."). I'd rather see him choose simplicity over features which
remove keystrokes at the cost of added complexity, unless the feature adds a
&lt;em&gt;lot&lt;/em&gt; of power. I don't think that decorators meet this criteria.&lt;p&gt;
A lisp master's code might do something complicated in 10 lines, while it takes
a Python wizard 25. However, it is a hell of a lot easier for a person with
only a moderate understanding of each language to figure out the python wizard's
code than it is for him to understand the equivalent lisp code (IMHO,
naturally). This is a feature of Python that I like.&lt;p&gt;
Wizards can have their lisp, I'd rather save my limited brainpower for getting
things done in a readable way, even if it's not in the fewest lines of code
possible.
</summary>
		<content type="html">&lt;a href="http://dirtsimple.org/"&gt;Phillip J. Eby&lt;/a&gt; writes:&lt;p&gt;
&lt;blockquote&gt;the issue with his use of decorators (to me anyway) wasn't that he 
used them, but that he had a really silly name for the decorator.  Instead of 
@param, it should've been called something like @call_with or @test_with.
Then, the code would have made more sense when reading.&lt;/blockquote&gt;&lt;p&gt;
While I agree with your point, Phillip, I still feel that there's a greater
issue at hand. I don't think that Ian's use of a decorator to create a testing
function is simpler than the alternative he prevents. Thus, I don't think that
he should use a decorator in that circumstance.&lt;p&gt;
&lt;blockquote&gt;With properly named and documented decorators, it shouldn't be 
necessary to understand their implementation&lt;/blockquote&gt;&lt;p&gt;
I've always had problems with this theory. Know the interface, and assume that
it works by "magic", it says. While that's fine in theory, I find that I am far
less effective when I use a framework or interface and not what goes on behind
it. It may just be that the way I think requires me to understand the
underlying technology in a way that other people don't need to, but I am just
not comfortable using an implementation of something I don't understand.&lt;p&gt;
Obviously, there have to be exceptions, as some things would require an
indordinate amount of effort to understand deeply. While I allow that this is
sometimes true (CPython and wxWindows come to mind), I work hard to increase my
understanding of the underlying technology every time I get a chance to do so.
I find that the more I know about it, the better my code gets, and that I often
get "aha!" moments as I grasp more of the framework.&lt;p&gt;
Furthermore, it seems to me that this statement is less true in Python than in
Java, as Python allows extraordinary simplicity. This is one of the main
reasons why I like the language, and this is one of the reasons I dislike 
extensions to it which encourage complexity.&lt;p&gt;
&lt;a href=http://effbot.org/"&gt;Fredrik&lt;/a&gt; writes:&lt;p&gt;
&lt;blockquote&gt;I'm beginning to realize that the people who are the most 
enthusiastic about things like metaclasses, decorators, 
nested-functions-instead-of-classes, etc. do not think in the same Python as 
I do&lt;/blockquote&gt;&lt;p&gt;
I don't know if I'd state it quite that strongly, but I do see a new trend in
the way that people want to use python. I find myself using nested functions,
but very occasionally, and only in limited circumstances. I mainly find them 
useful in mathematical contexts.&lt;p&gt;
What scares me is what I see as the c++ification (if I may coin a term) of our
language. The community seems content to move towards adding language features
that are useful only to the wizards of the language. This is fine for the
wizards, but it tends to create a second class of programmer. These
second-class programmers, who just want to get things done, understand the 
basics of the language, but simply assume that code which contains metaphors 
they don't understand is unreadable.&lt;p&gt;
I think that metaclasses (which I just assume I don't understand, myself) and
decorators (which required me to waste a lot of time just to understand how
simple they are) are both steps down this road, unfortunately.&lt;p&gt;
&lt;a href="http://apipes.blogspot.com/2004/12/bill-mill-on-decorators.html"&gt;Tim
Lesher&lt;/a&gt; writes on his blog:&lt;p&gt;
&lt;blockquote&gt;My only, weak answer [to "why should I use a metaclass?"] was, "If 
you think you need one, you don't. 
If you know you need one, why are you taking advice from me?"&lt;/blockquote&gt;&lt;p&gt;
That is exactly what I meant to say when I asked people to leave decorators to
the Other People. The set of features that require 
this sort of response is almost exactly equivalent to
the set of features that I don't like.&lt;p&gt;
Finally, &lt;a href="http://bob.pycs.net/"&gt;Bob Ippolito&lt;/a&gt;, who really should
pick &lt;a href="http://pyblosxom.sourceforge.net"&gt;pyblosxom&lt;/a&gt; for his new blog
server (/marketing), writes:
&lt;blockquote&gt;Personally, I think that decorators serve a useful purpose.  There 
are many cases where they save you from spelling out an identifier three times.
Repetition is stupid, and Python doesn't otherwise have a lot of repetition, 
but function transformations need them since functions are statements and not 
expressions.&lt;br&gt;&lt;br&gt;
Maybe I should just use lisp instead.&lt;/blockquote&gt;
&lt;p&gt;In my mind, simplicity is a greater goal of python than is the avoidance of
repetition. GvR has often made it clear that limiting the number of keystrokes
is not one of his guiding factors in desiging the language ("
This is *not* a number-of-keystrokes argument. You know I don't care
much about that."). I'd rather see him choose simplicity over features which
remove keystrokes at the cost of added complexity, unless the feature adds a
&lt;em&gt;lot&lt;/em&gt; of power. I don't think that decorators meet this criteria.&lt;p&gt;
A lisp master's code might do something complicated in 10 lines, while it takes
a Python wizard 25. However, it is a hell of a lot easier for a person with
only a moderate understanding of each language to figure out the python wizard's
code than it is for him to understand the equivalent lisp code (IMHO,
naturally). This is a feature of Python that I like.&lt;p&gt;
Wizards can have their lisp, I'd rather save my limited brainpower for getting
things done in a readable way, even if it's not in the fewest lines of code
possible.
</content>
	</entry>
</feed>
