Coding Standards and Formatting
Coding standards
Here's the list we try to follow :
- Short method bodies, hopefully five lines or less.
- No abbreviations in names, so $parameter rather than $param.
- ClassLikeThis, methodLikeThis(), $variables_like_this.
- get/set for accessors.
- Accessors even when a subclass calls a superclass.
- Longish class and method names except for specifications.
- "Simple" as a class name prefix unless it really pollutes the domain language.
- 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 { //stuff }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.
And other Code formatting stuff.