Spiga

PHP Coding Standards

Over at WACT the question of coding standards has raised it’s (ugly?) head. There’s now this page on the WIKI linking to more or less every PHP coding standards document that’s ever made it’s way online (feel free to add more).

By “coding standards” we’re talking whether you use tabs or spaces for indention, whether you name functions likeThis(), LikeThis() or like_this().

Now for some people this is really important. Risking flames, I think it’s just “nice to have”.

If you’re collaborating in a team, so long as you display basic “code hygene”, that’s enough. With reasonably experienced developers, conventions on naming class methods and so on will likely evolve without even needing to discuss them.

What’s more, think the subject is largely a distraction from more important issues. Try asking the next Java developer you meet what the word “standards” means to them… Having clearly defined APIs for things like Iterators is far more important, IMO.

0 comments: