Code Standards » History » Version 13
  Amber Herold, 05/19/2011 09:48 AM 
  
| 1 | 1 | Amber Herold | h1. Code Standards  | 
|---|---|---|---|
| 2 | |||
| 3 | If everyone uses the same coding style, it is much easier to read code that someone else wrote. That said, style is not important enough to enforce during a code review. It is much more important to ensure that best practices are followed such as implementing error handling .  | 
||
| 4 | |||
| 5 | 2 | Amber Herold | h2. Python  | 
| 6 | |||
| 7 | 1 | Amber Herold | "Python Style Guide":http://www.python.org/dev/peps/pep-0008/  | 
| 8 | 9 | Neil Voss | [[Python Coding Standards]]  | 
| 9 | 2 | Amber Herold | |
| 10 | h2. PHP  | 
||
| 11 | |||
| 12 | 3 | Amber Herold | This one is a bit old, but lots of good stuff that goes beyond style. Some things are questionable. I prefer Getters/Setters over Attributes as Objects (at least how the example shows it) to allow for better error handling. I prefer no underscores in naming except for constants that use all caps...but that is only a style issue.  | 
| 13 | 2 | Amber Herold | |
| 14 | "PHP Coding Standard":http://www.dagbladet.no/development/phpcodingstandard/  | 
||
| 15 | 4 | Amber Herold | |
| 16 | From the Zend framework folks:  | 
||
| 17 | http://framework.zend.com/manual/en/coding-standard.html  | 
||
| 18 | 5 | Amber Herold | |
| 19 | An intro:  | 
||
| 20 | http://godbit.com/article/introduction-to-php-coding-standards  | 
||
| 21 | 6 | Amber Herold | |
| 22 | Nice Presentation:  | 
||
| 23 | 7 | Amber Herold | http://weierophinney.net/matthew/uploads/php_development_best_practices.pdf  | 
| 24 | |||
| 25 | 8 | Amber Herold | PHP Unit testing  | 
| 26 | 6 | Amber Herold | http://www.phpunit.de/pocket_guide/  | 
| 27 | 7 | Amber Herold | |
| 28 | For automatically checking code against the Pear standards use CodeSniffer:  | 
||
| 29 | http://pear.php.net/package/PHP_CodeSniffer/  | 
||
| 30 | 10 | Amber Herold | |
| 31 | 13 | Amber Herold | h2. JavaScript  | 
| 32 | |||
| 33 | Improved performance:  | 
||
| 34 | http://blog.monitis.com/index.php/2011/05/15/30-tips-to-improve-javascript-performance/  | 
||
| 35 | |||
| 36 | 10 | Amber Herold | h2. Any Language  | 
| 37 | |||
| 38 | 11 | Amber Herold | "DRY principle":http://c2.com/cgi/wiki?DontRepeatYourself : Don't Repeat Yourself  | 
| 39 | 12 | Amber Herold | "Joomla guide":http://developer.joomla.org/strategy.html  |