NYCPHP Meetup

NYPHP.org

[nycphp-talk] Best practices for naming conventions & coding style?

Justin Hileman justin at justinhileman.info
Mon Apr 27 18:00:08 EDT 2009


lists at nopersonal.info wrote:
> I've been making steady (if slow) progress with my understanding of
> PHP/MySQL, but now that I'm finally starting to do more complex things,
> I find that I really need to figure out a consistent naming convention&
> coding style. I've read several articles on the subject and they all
> seem to be different.
>    

For your own work, find one that works for you and stick with it.

If you're looking for suggestions, I tend to use a modified PEAR coding 
style--with a just a handful of exceptions where they got stupid--when I 
write PHP. It's a lot like K&R/1TBS, so it's comfortable to me... And it 
helps that several of the projects I work on have compatible coding 
standards.

See:

http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS
http://pear.php.net/manual/en/standards.php
http://drupal.org/coding-standards
http://zoopframework.com/docs/coding-standard

-- 
justin
http://justinhileman.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090427/7e67379c/attachment.html>


More information about the talk mailing list