Adoption of Coding Standards

I completely embrace the idea of coding standards, and for a long time I’ve used my own. This morning I have decided that from now on I will be following the coding standards set fourth by the Zend Framework.

http://framework.zend.com/manual/en/coding-standard.html

This is a decision I don’t make lightly, and one that I have been toying with for a long time.  Do you have a particular set of standards you follow?

Tags:

4 Responses to “Adoption of Coding Standards”

  1. pokoka Says:

    I came to the same conclusion two weeks ago. I’ve toyed with the idea (coding standards for PHP) for years.

    With Symbian C++ I follow the standards to the ‘letter’ (well, you have too really) but with the freedom PHP provides its so easy to develop ones own coding style.

    I use PHP-CLi for my (personal) shell scripting which never did help convince me to adhere to coding standards. It’s so easy to start with a few lines of procedural code and end up with some really handy class to reuse elsewhere. Ends up being a bit of a mish mash of course with variables in camel back, humpty dumpty, VB notation (oh the joy!).

    Anyhow, Zend and PHP go ‘hand in hand’ so the way i see it one can’t go wrong using their coding standards.

  2. leveille Says:

    My feeling is that knowing how you are going to code (spacing/indentation/naming conventions/etc), though it may seem trivial, is really very important. It is one less thing to think about as you are coding. Unfortunately I haven’t been as consistent in the past as I should have been, however the decision to adopt Zend’s standards has put my mind at ease a little bit.

    Regardless of what I am talking about in development I almost always end up asking myself the same question: how can I manage complexity in my code, and ultimately make it more maintainable. The answer to this is sometimes as simple as adopting coding standards.

  3. Travis Swicegood Says:

    I’d recommend taking a look at the PEAR CS. Particularly the PEAR2 CS for code with namespaces. The PEAR standard has been around for a long time and was the base for the ZF standard as far as I can tell.

    Disclaimer: I’m a member of the PEAR Group, so take what I say with a grain of salt…

  4. leveille Says:

    Thanks for stopping by Travis. Long time follower of your work. For anyone interested, the standards Travis is talking about are located at:

    http://pear.php.net/manual/en/standards.php

    I’m going to find some time tonight and take a closer look.

Leave a Reply