← Best Practice
A best practice is a method or technique that has consistently shown results superior to those achieved with other means, and that is used as a benchmark. In addition, a "best" practice can evolve to become better as improvements are discovered. ~ Wikipedia
- Document everything. There is no such thing as too much documentation.
- Don't duplicate the functionality of a built-in library.
- Don't swallow exceptions or "fail silently".
- Don't write code that guesses at future functionality.
- Exceptions should be exceptional.
- Keep the code simple.
- Avoid global variables.
- Avoid long parameter lists.
- Limit collaborators of an object (entities an object depends on).
- Limit an object's dependencies (entities that depend on an object).
- Prefer composition over inheritance.
- Prefer small methods. Between one and five lines is best.
- Prefer small objects with a single, well-defined responsibility. When an object exceeds 100 lines, it may be doing too many things.
- Prefer MySQL
- Prefer InnoDB Storage Engine (if using MySQL)
- Naming DB column titles by separating words with underscores
- Use LESS.
- Don't support IE6 or IE7.