A design problem I met again and again.

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Apr 3 06:23:42 CEST 2009


On Thu, 02 Apr 2009 16:51:24 -0700, Emile van Sebille wrote:

> 一首诗 wrote:
>> Hi all,
>> 
>> I am a programmer who works with some different kinds of programming
>> languages, like python, C++(in COM), action script, C#, etc.
>> 
>> Today, I realized that, what ever language I use, I always meet a same
>> problem and I think I never solve it very well.
>> 
>> The problem is : how to break my app into functional pieces?
> 
> My question would be why?  Refactoring adds nothing to a functioning app
> but clarity and maintainability -- both admirable qualities, granted,
> and both unnecessary until needed.

But they're always needed, except possibly for use-once throw-away 
scripts.


> When I need to update an app is when
> I start refactoring, and then just those areas that need it.  Certainly
> I refactor constantly during development 

Well, that pretty much disproves your assertion that refactoring is only 
needed when updating an application.


> 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, clear and maintainable, then there's very little 
refactoring left to do. I don't think anyone suggests that you refactor 
code that doesn't need refactoring. Once it is already split into 
functional pieces, there's no need to continue breaking it up further.



-- 
Steven



More information about the Python-list mailing list