Making the case for repeat

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Mon Jun 8 11:44:30 CEST 2009


On Mon, 08 Jun 2009 18:30:37 +1000, Ben Finney wrote:

> Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> writes:
> 
>> On Sun, 07 Jun 2009 16:46:23 -0700, Raymond Hettinger wrote:
>> 
>> > We factor code to eliminate redundancy, but that is not always a good
>> > idea with an API. The goal for code factoring is to minimize
>> > redundancy. The goal for API design is having simple parts that are
>> > easily learned and can be readily combined (i.e. the notion of an
>> > iterator algebra).
>> 
>> Wonderfully said! That has articulated something which I only recently
>> came to appreciate, but couldn't put into words.
> 
> As originally defined by Martin Fowler, re-factoring always means the
> external behaviour is unchanged <URL:http://refactoring.com/>.
> 
> So, there's no such thing as a re-factoring that changes the API.
> Anything that changes an external attribute of the code is a different
> kind of transformation, not a re-factoring.

Possibly a *factoring*, without the "re-", just like Raymond said.

Also, keep in mind that when creating a new API, you have no existing API 
to re-factor.


-- 
Steven



More information about the Python-list mailing list