#native_company# #native_desc#

Best Practices: PHP Coding Style

By Tim Perdue
on January 3, 2001

One of PHP’s greatest strengths can also be a great weakness in the wrong
hands. I’m talking about its forgiving nature. One of the reasons why
PHP has become so wildly popular is because it lets very inexperienced
web developers build powerful applications without much planning, consistency,
or documentation.
Unfortunately, that means an awful lot of PHP code out there is sloppy,
hard to read and impossible to maintain. I know because I’ve written a lot
of it ;-).
To address this and a lot of other issues, a number of the core PHP
developers and community members got together and started the PEAR
Project, which stands for PHP Extension and Add-on Repository.
To date, the docs and other fruit from the PEAR project have been pretty
sparse and difficult to follow, so this article is an attempt to shed some
light on what they’re doing.
A pretty huge part of maintainability of code is how it is formatted
and commented. All code throughout a given project should be formatted the same
way. I’m a pretty big stickler about this in the SourceForge codebase and
you should be too.