[campsite-dev] coding conventions
  • I want to remind everyone of our coding conventions. In particular
    these things:

    1. Always use braces, even for single statements.

    Example:

    if ($x == 0) {
    $x++;
    }


    2. Always parenthesis boolean expressions.

    Example:

    if ( ($x == 0) || ($y == 0))

    Counter-example (what NOT to do):
    if ( $x == 0 || $y == 0 )


    3. Put ELSE on the same line as closing IF "}", and use space characters
    to separate tokens as in the following example.

    Example:

    if ( ($x == 0) || ($y == 0) ) {
    $x = 1;
    } else {
    $x = 2;
    }