SPUG: Regexp::Assemble question

Michael R. Wolf MichaelRWolf at att.net
Wed Feb 25 13:04:24 PST 2009


On Feb 25, 2009, at 12:48 PM, Croote, Rick wrote:

> As always, we would all probably have written this differently, as  
> Andrew stated, but John was bringing home a point that is typically  
> a pet peeve of mine, code duplication, which in this case was kind  
> of minor, but is all too often seen at much larger scales.


Anyone read "Refactoring" by Martin Fowler?  I enjoyed it a decade ago  
when I first read it.  I occasionally pick it up, and play with a  
chapter (or two) as a mental game of "Twister".  It's great to see two  
pieces of code that do identical things with the constant part  
factored into one location and the variable part factored into another  
location.

I recently heard someone mention a new (for me) acronym:
    DRY - Don't Repeat Yourself

It's a great mantra for designing classes, refactoring code, and even  
technical writing.  It's also a good "red flag" for me.  If I find  
myself repeating something, it's often a signal that I'm heading down  
a path that's not as maintainable as it could be.

Thanks...

P.S. Anyone know of refactoring editors that work?  If so, what  
languages are they good at?  Any pointers to Perl-language ones?  I'd  
heard that some of the upcoming features of the language would lend  
themselves toward better Perl editors (code folding, refactoring)  
since it would get away from the age-old constraint of "Only perl(1)  
parses Perl".  Having an API to the Perl parser should open up a lot  
of great code analysis tools.

-- 
Michael R. Wolf
     All mammals learn by playing!
         MichaelRWolf at att.net






More information about the spug-list mailing list