Coding Standards and Formatting

Coding standards

Here's the list we try to follow :

  1. Short method bodies, hopefully five lines or less.
  2. No abbreviations in names, so $parameter rather than $param.
  3. ClassLikeThis, methodLikeThis(), $variables_like_this.
  4. get/set for accessors.
  5. Accessors even when a subclass calls a superclass.
  6. Longish class and method names except for specifications.
  7. "Simple" as a class name prefix unless it really pollutes the domain language.
  8. Eric Evans domain driven design style rather than pure TDD. That is, slight over design in order to make concepts clear.

Obviously these reflect Marcus Bakers's average coding style over several projects and programming languages.

Should also be obvious that the code is riddled with exceptions to these rules :).

Code formatting

Please no dangling brace style...

class MyClass
It wastes vertical space and is a hangover from long declarations in C++. White space to me should separate something, such as a method or class. The same for docblocking private members.