Project

General

Profile

Code Standards » History » Revision 17

Revision 16 (Amber Herold, 07/06/2011 12:10 PM) → Revision 17/21 (Amber Herold, 07/11/2011 09:10 AM)

h1. Code Standards 

 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 . 

 h2. Python 

 * "Python Style Guide":http://www.python.org/dev/peps/pep-0008/ 
 * [[Python Coding Standards]] 
 * http://blog.dispatched.ch/2011/06/12/how-to-become-a-proficient-python-programmer/ 
 * http://lucumr.pocoo.org/2011/7/9/python-and-pola/ 

 h2. PHP 

 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. 

 "PHP Coding Standard":http://www.dagbladet.no/development/phpcodingstandard/ 

 From the Zend framework folks: 
 http://framework.zend.com/manual/en/coding-standard.html 

 An intro: 
 http://godbit.com/article/introduction-to-php-coding-standards 

 Nice Presentation: 
 http://weierophinney.net/matthew/uploads/php_development_best_practices.pdf 

 PHP Unit testing 
 http://www.phpunit.de/pocket_guide/ 

 For automatically checking code against the Pear standards use CodeSniffer: 
 http://pear.php.net/package/PHP_CodeSniffer/ 

 h2. JavaScript 

 Improved performance: 
 http://blog.monitis.com/index.php/2011/05/15/30-tips-to-improve-javascript-performance/ 

 h2. Any Language 

 "DRY principle":http://c2.com/cgi/wiki?DontRepeatYourself : Don't Repeat Yourself 
 "Joomla guide":http://developer.joomla.org/strategy.html 
 "OOP and starting point for PHP and Javascript specific OOP":http://nefariousdesigns.co.uk/archive/2006/05/object-oriented-concepts/ 

 h2. Web performance best practices 

 "Googles Guide":http://code.google.com/speed/page-speed/docs/rules_intro.html