Run scripts/setup
to install dependencies needed to transpile js and run tests
Run scripts/test
to run tests. This will leave the test runner running while watching for code changes.
Firstly, the goal of all code written should aim to satisfy the four principles of simple design:
- Passes all the tests
- Expresses every idea that we need to express
- Says everything once and only once
- Has no superfluous parts
Secondly, here are some constraints you can apply to your coding session to help drive you towards different aspects of simple design:
- TDD (you should always do this)
- No
if
statements - No loops
- Small methods (< 4 lines)
- Immutables only
- Verbs instead of nouns
- Code Swap
- Object Calisthenics
- Only one level of indentation per method
- Don't use the
else
keyword - Wrap all primitives and strings
- First class collections
- One dot per line
- Don't abbreviate
- Keep all entities small
- No classes with more than two instance variables
- No getters/setters/properties