NYCPHP Meetup

NYPHP.org

[nycphp-talk] Code cleanliness vs. code popularity

Jayesh Sheth jay_nyphp at fastmail.fm
Fri Sep 16 10:21:04 EDT 2005


Hello all,

I was recently reading through the phpBB source code, and had some
observations to shares. In most of the pages / script files I looked
through, there were 1000 - 2000 lines of PHP code, with no functions or
comments. While the code itself is strictly procedural, it is also to
the point, and not indecipherable.

Still, some interesting questions came to me: how can one of the most
popular PHP applications be written in eighties-style procedural code?
Or, to rephrase it: are object-oriented design, (fancy) frameworks not
useful in practice? How many of you have worked with commercial, open
source or in-house frameworks? Have you found these frameworks to be
useful in the long run, or do they just get in the way?

I have long been a fan of PEAR (and other external / third-party)
libraries. I much prefer to save myself work, when I do not have to
reinvent the wheel. Still, in many companies, people prefer to write
everything from scratch, often wrapped up in laborious frameworks. In
your collective experience, what's the best policy for code development?
In other words: bang it out, test it, ship it, receive feedback, fix it,
and then back to the beginning again, or: huge design upfront, OO or
functionized code,UML diagrams, and the 'f' word: a framework.

I personally cannot write strictly procedural code any more, and I
prefer a mix of functionized and OO code. Still, real world applications
- popular real world applications, often totally avoid this approach.
So, what gives?

- Jay



More information about the talk mailing list