Rapid Application Development with Open Source Software

Next: Data Model for PostgreSQL 9.4 UP: TOC

Code conventions are important to programmers for various reasons:

  • 40%–80% of the lifetime cost of software goes to maintenance. Hardly any software is maintained for its whole life by the original author.
  • Code conventions improve the readability of the software, allowing engineers to understand new code more quickly and thoroughly.
http://en.wikipedia.org/wiki/Coding_conventions

For this book we will stick to the standards of http://www.php-fig.org/psr/psr-2/. Here is an overview of theses conventions in brief

Four Spaces for Indentation

Control Structures

if ((expr_1) || (expr_2)) {
    // action_abc;
} elseif (!(expr_3) && (expr_4)) {
    // action_xyz;
} else {
    // default_action;
}
refer to http://book.cakephp.org/3.0/en/contributing/cakephp-coding-conventions.htmlNext: Data Model for PostgreSQL 9.4 UP: TOC