You are here: Documentation » Miscellaneous Documentation » Coding Standards
Coding Standards
If you want to contribute a patch to SimplePie, please follow these coding guidelines.
Quotes
Understand the difference between single and double quotes. Use whichever is more appropriate.
Indentation
Indentation should follow the logical structure of the code. Use real tabs not spaces.
Brace Style
If there are 2 or more actions for the condition, brace style should be as follows:
if ((condition1) || (condition2)) { action1; action2; } elseif ((condition3) && (condition4)) { action3; action4; } else { defaultaction1; defaultaction2; }
Regular Expressions
Perl compatible regular expressions (PCRE) should be used instead of their POSIX counterparts.
No Shorthand PHP
Never, ever, use shorthand PHP start tags. The world will come to an end if you do. Always use <?php … ?>
Ternary operators
Don't test if the statement is false. That becomes confusing fast. Also, don't put functions on either side of the semi-colon.
misc/coding_standards.txt · Last modified: 2011/03/06 03:56 (external edit)