Patterns and all that new fangled stuff ...

Sean 'Shaleh' Perry shalehperry at attbi.com
Wed Jul 3 10:56:37 EDT 2002


On 03-Jul-2002 Max M wrote:
> For the fun and education of it I have recently tried to refactor one of 
> my projects using patterns.
> 
> I did expect the code to be longer and more verbose, but was a little 
> surprised when I found out that it got exactly twice as long ...
> 
> But I know the code too well and cannot be objective about it, so I 
> thought I would like to get a second opinion. Which code would you guys 
> prefer to maintain down the line. The short "linear" version or the 
> object oriented "pattern" version. Which one is the easiest to read?
> 
> It as an .asp project. I have chosen not to include the html part of it 
> as it just inserts html generated from the Python code.
> 

if your new facade class is only used once, in one place there is little
benefit.  However if this type of thing occurs in several places you have no
limited your changes to one class rather than every call.

A programmer must learn when to use a tool.  Just because you have a toolbox
brimming with solutions does not mean you should use all of them on a single
project.





More information about the Python-list mailing list