Extremist Developer

RSS

Be Consistent

If I had a list of things that annoy the shit out of me, lack of consistency in coding style would be on the top of it, or at least close to it.

What is worst than lurking into a library, a site source code, and being lost in the middle of an epic battle between 10 different coding styles. Camel case, no camel case, inconsistent naming convention, brackets on a new line, bracket at the end of the line, and I could go on for 400 pages (at least it would be better reading than Twilight).

I don’t care how you’re coding, what style do you prefer, but please, be consistent with it. When I read such code, I can’t picture a good developer, a developer that care about what he is doing, and it reflects poorly on you. If you’re working in team, set some guidelines, it will make everyone happy and your life a lot easier.

And while we’re at it, that would be nice to put those documentation headers in your classes, on top of your functions, even if a good programmer should be able to understand what a piece of code does rather quickly, having those headers makes it a lot easier.

In the end, being a good programmer is not only about the shit you write and how fucking good it is, it’s also about how pleasant it is to read and use, coding style is not a bonus if you want to produce quality code.

If you’re a PHP developer here is some reading you should be doing:

Zend Coding Standards for PHP

PEAR Coding Standards

Horde Coding Standards

And if you’re not a PHP developer, well I hope you know how to use Google.