Here are some principles I try to keep in mind.
|Readability||Make code easy to read: code is read more often than
|DRYness: Don’t Repeat Yourself||Avoid redundant code and data.|
|YAGNIty: You Ain’t Gonna Need It||Don’t write code before it’s needed.|
|Sloth||Maximize use of existing packages and libraries. The line of code you don’t write is the line of code you never have to debug. — Steve Jobs|
|Explicitness||Explicate everything, even when “unnecessary.” If it goes without saying, it would go better by saying it. — Tallyrand|
|Cleanliness||Keep everything clean and consistent: run static code
analysis; resolve all issues before committing.
|Failed Verdict Diagnostics||Log data sufficient to diagnose a failed verdict.|
|Error Diagnostics||Detect test errors early, fail early, log useful information.|
|Monitoring||Trust, but verify. Monitor documentation for changes (programatically, of course).|