[nycphp-talk] Code cleanliness vs. code popularity
joshmccormack at travelersdiary.com
joshmccormack at travelersdiary.com
Fri Sep 16 10:52:01 EDT 2005
I haven't heard too many kind things said of phpBB code - it frequents
the security warning lists, doesn't it?
I don't understand why someone wouldn't use functions. I don't profess
to be an expert, knowing tons of patterns and in the ins-and-outs of OO
programming. But I used functions anywhere I can - Javascript, PHP,
Java, etc. It just seems so natural.
Here's my funny story that tells you about people not using frameworks.
Before PHP had really risen to what it is, and Perl reigned mighty, I
knew a guy who worked at Cold Spring laboratories, down the hall from
the author of CGI.pm, arguably the Perl framework for web stuff. And he
refused to use modules, he wanted to write everything himself.
I have my own method of evaluating packages, frameworks, etc. which I do
before using any, but I always try to use other's hard work, rather
than reinvent the wheel.
Josh
Jayesh Sheth <jay_nyphp at fastmail.fm> wrote on 09/16/2005, 04:21:04 PM:
> 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
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
More information about the talk
mailing list