This shows you the differences between two versions of the page.
— |
quickbooks_integration_php_consolibyte_codingstandards [2013/01/21 12:44] (current) |
| + | ====== Coding Standards for Contributors ====== |
| + | |
| + | ===== Subversion / SVN Access ===== |
| + | |
| + | The preferred contribution method is via checking in subversion updates. Please contact me for svn access. |
| + | |
| + | ===== Coding Standards ===== |
| + | |
| + | brackets: |
| + | |
| + | <code> |
| + | GOOD: |
| + | if (something) |
| + | { |
| + | // do something |
| + | } |
| + | |
| + | BAD: |
| + | if (something) { |
| + | // do something |
| + | } |
| + | </code> |
| + | |
| + | |
| + | line endings: |
| + | |
| + | <code> |
| + | GOOD: |
| + | ------------ |
| + | <?php |
| + | |
| + | // your code here ... |
| + | |
| + | ------------ |
| + | |
| + | BAD: |
| + | ------------ |
| + | <?php |
| + | |
| + | // your code here ... |
| + | |
| + | ?> |
| + | ------------ |
| + | </code> |
| + | |
| + | |
| + | <code> |
| + | OTHER BAD THINGS: |
| + | |
| + | // not using brackets is bad! |
| + | if (something) do_something() |
| + | |
| + | // this is so confusing, bad! |
| + | $action = (empty($_POST['action'])) ? 'default' : $_POST['action']; |
| + | |
| + | // not using '' to surround array indexes throws a PHP notice, bad! |
| + | $var = $array[index]; |
| + | </code> |
| + | |
| | | |