NYCPHP Meetup

NYPHP.org

[nycphp-talk] [Re: Code cleanliness vs. code popularity]

Chris Shiflett shiflett at php.net
Sun Sep 18 15:45:14 EDT 2005


Matthew Terenzio wrote:
> If you know exactly what you want and it won't change, write a
> bunch of scripts.
> 
> If things might change down the line, encapsulate it. Then you
> can modify things without breaking it.
> 
> That said, it's certainly possible to make large, flexible 
> applications using procedural programming techniques, but
> thinking about the issues which OO was made to solve.

I tend to write more procedural code than OO, and I agree with this 
statement. Of course you can do just as much with a procedural paradigm, 
but it's good to sometimes step back and make sure you're not solving 
too many of the same problems that OO solves. I can usually tell that 
I've chosen the wrong approach when one of two things happens:

1. I'm writing procedural code, and I'm cobbling together some of the 
same features that are inherent in an OO approach.

2. I'm writing OO code, but I'm not really using any of its features.

That's my personal sanity check. :-)

Chris

-- 
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/



More information about the talk mailing list