A design problem I met again and again.

Emile van Sebille emile at fenx.com
Fri Apr 3 01:18:02 EDT 2009


Steven D'Aprano wrote:
> On Thu, 02 Apr 2009 16:51:24 -0700, Emile van Sebille wrote:
<snip>
>> I refactor constantly during development to avoid code reuse through
>> cut-n-paste, but once I've got it going, whether it's 1000 or 6000
>> lines, it doesn't matter as long as it works.
> 
> If you've been refactoring during development, and gotten to the point 
> where it is working, 

yes, but

> clear and maintainable, 

not necessarily

> then there's very little refactoring left to do. 

Again, not necessarily.  I often find it easier to refactor old code 
when I'm maintaining it to better understand how to best implement the 
change I'm incorporating at the moment.  The refactoring certainly may 
have been done when the code was originally written, but at that time 
refactoring would have only served to pretty it up as it already worked.

> I don't think anyone suggests that you refactor 
> code that doesn't need refactoring. 

That's exactly what I read the OP as wanting to do. That's why I was 
asking why.  So, I think the question becomes, when does code need 
refactoring?

Emile




More information about the Python-list mailing list