Code Standards » History » Version 16
Amber Herold, 07/06/2011 12:10 PM
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 | 14 | Amber Herold | * "Python Style Guide":http://www.python.org/dev/peps/pep-0008/ |
8 | * [[Python Coding Standards]] |
||
9 | * http://blog.dispatched.ch/2011/06/12/how-to-become-a-proficient-python-programmer/ |
||
10 | 2 | Amber Herold | |
11 | h2. PHP |
||
12 | |||
13 | 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. |
14 | 2 | Amber Herold | |
15 | "PHP Coding Standard":http://www.dagbladet.no/development/phpcodingstandard/ |
||
16 | 4 | Amber Herold | |
17 | From the Zend framework folks: |
||
18 | http://framework.zend.com/manual/en/coding-standard.html |
||
19 | 5 | Amber Herold | |
20 | An intro: |
||
21 | http://godbit.com/article/introduction-to-php-coding-standards |
||
22 | 6 | Amber Herold | |
23 | Nice Presentation: |
||
24 | 7 | Amber Herold | http://weierophinney.net/matthew/uploads/php_development_best_practices.pdf |
25 | |||
26 | 8 | Amber Herold | PHP Unit testing |
27 | 6 | Amber Herold | http://www.phpunit.de/pocket_guide/ |
28 | 7 | Amber Herold | |
29 | For automatically checking code against the Pear standards use CodeSniffer: |
||
30 | http://pear.php.net/package/PHP_CodeSniffer/ |
||
31 | 10 | Amber Herold | |
32 | 13 | Amber Herold | h2. JavaScript |
33 | |||
34 | Improved performance: |
||
35 | http://blog.monitis.com/index.php/2011/05/15/30-tips-to-improve-javascript-performance/ |
||
36 | |||
37 | 10 | Amber Herold | h2. Any Language |
38 | |||
39 | 11 | Amber Herold | "DRY principle":http://c2.com/cgi/wiki?DontRepeatYourself : Don't Repeat Yourself |
40 | 12 | Amber Herold | "Joomla guide":http://developer.joomla.org/strategy.html |
41 | 16 | Amber Herold | "OOP and starting point for PHP and Javascript specific OOP":http://nefariousdesigns.co.uk/archive/2006/05/object-oriented-concepts/ |
42 | 15 | Amber Herold | |
43 | h2. Web performance best practices |
||
44 | |||
45 | "Googles Guide":http://code.google.com/speed/page-speed/docs/rules_intro.html |