Project

General

Profile

Code Standards » History » Version 19

Amber Herold, 07/26/2011 11:33 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 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 17 Amber Herold
* http://lucumr.pocoo.org/2011/7/9/python-and-pola/
11 2 Amber Herold
12
h2. PHP
13
14 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.
15 2 Amber Herold
16
"PHP Coding Standard":http://www.dagbladet.no/development/phpcodingstandard/
17 4 Amber Herold
18
From the Zend framework folks:
19
http://framework.zend.com/manual/en/coding-standard.html
20 5 Amber Herold
21
An intro:
22
http://godbit.com/article/introduction-to-php-coding-standards
23 6 Amber Herold
24
Nice Presentation:
25 7 Amber Herold
http://weierophinney.net/matthew/uploads/php_development_best_practices.pdf
26
27 8 Amber Herold
PHP Unit testing
28 6 Amber Herold
http://www.phpunit.de/pocket_guide/
29 7 Amber Herold
30
For automatically checking code against the Pear standards use CodeSniffer:
31
http://pear.php.net/package/PHP_CodeSniffer/
32 10 Amber Herold
33 13 Amber Herold
h2. JavaScript
34
35
Improved performance:
36
http://blog.monitis.com/index.php/2011/05/15/30-tips-to-improve-javascript-performance/
37
38 10 Amber Herold
h2. Any Language
39
40 18 Amber Herold
* "DRY principle":http://c2.com/cgi/wiki?DontRepeatYourself : Don't Repeat Yourself
41
* "Joomla guide":http://developer.joomla.org/strategy.html
42
* "OOP and starting point for PHP and Javascript specific OOP":http://nefariousdesigns.co.uk/archive/2006/05/object-oriented-concepts/
43
* http://www.artima.com/weblogs/viewpost.jsp?thread=331531
44 15 Amber Herold
45
h2. Web performance best practices
46
47 19 Amber Herold
* "Googles Guide":http://code.google.com/speed/page-speed/docs/rules_intro.html
48
49
h2. Database
50
51
* http://codebalance.blogspot.com/2011/07/20-database-design-best-practices.html