/code-katas-js

Bowling Code Kata in Javascript

Primary LanguageJavaScriptMIT LicenseMIT

Code Katas in Javascript

Setup and Tests

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.

Katas

  1. Bowling
  2. Game of Life

Kata Constraints

Firstly, the goal of all code written should aim to satisfy the four principles of simple design:

  1. Passes all the tests
  2. Expresses every idea that we need to express
  3. Says everything once and only once
  4. 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:

  1. TDD (you should always do this)
  2. No if statements
  3. No loops
  4. Small methods (< 4 lines)
  5. Immutables only
  6. Verbs instead of nouns
  7. Code Swap
  8. Object Calisthenics
  9. Only one level of indentation per method
  10. Don't use the else keyword
  11. Wrap all primitives and strings
  12. First class collections
  13. One dot per line
  14. Don't abbreviate
  15. Keep all entities small
  16. No classes with more than two instance variables
  17. No getters/setters/properties