The Advancing PHP Developer Part 1: Coding Standards

level upA question that I hear often is how can one evolve as a PHP developer? The answer varies and depends on the person’s programming knowledge and experience. I will cover the topics I think are the most important briefly in this series, provide links and maybe expand on them in the future.

I will assume intermediate level PHP competency as this is where most developers end up. They are capable of developing small projects, but their code isn’t of great quality and they waste time and resources solving the same problems again and again.

This guide is about improving:

  1. Maintainability
  2. Development speed
  3. Coding practices
  4. Toolset
  5. Deployment

Part 1. Coding standards

Why coding standards are important: Coding standards are all about improving maintainability and teamwork. High quality code should reveal its intention to competent programmers without relying on documentation, though any set of coding standards includes some documentation practices (my favorite are phpDoc blocks).

When I began to think about code as prose that should transmit its meaning rather than being merely functional, my code quality started to constantly improve. When you consider how code will look as well as work, you create code that is more readable and hence more maintainable and share-able (in a team setting).

Some languages, like Python, force the programmer to use a certain coding standards – which is why some love it and some hate it.

For PHP, I use the Zend Framework coding styles which I think are great.

Extra reference material:
Wikiepedia – Programming Style
PEAR coding standards
Professional PHP blog on coding standards
A list of coding style guides

Next up: Object Orientation.

To know when the next article is published, please subscribe to new articles using your Email below or follow me on Twitter.

Subscribe to Blog via Email

Enter your email address to receive notification about new posts.