-
Notifications
You must be signed in to change notification settings - Fork 6
Coding Guidelines
ironpilot edited this page Feb 20, 2015
·
3 revisions
- We use Allman style braces, where each brace begins on a new line. A single line statement block can go without braces but the block must be properly indented on its own line.
- We use tabs for indentation.
- We use
PascalCasefor class names. - We use
camelCaseproperties and method names within classes. - We always specify the visibility. (i.e.
public function writeMe()notfunction writeMe()). - Avoid more than one empty line at any time. For example, do not have two blank lines between class members.
- Avoid extra and trailing free spaces. For example avoid
if(myVar == 0)..., where the dots mark the excess free spaces. - If a file happens to differ in style from these guidelines, the existing style in that file will take precedence, until the entire file is refactored.
- Class constants are named in
ALL_CAPSwith underscores separating words and should be located as the first declaration in class definitions.