Refactoring and Self Reviews - sgml/signature GitHub Wiki

I realized that while itโ€™s great to take pride in your work, you should not attach your sense of self into your work. This is often because once you attach a sense of self or personal attachment into your work, it can become harder to accept criticism of your work and strive to iterate or improve on it.

Remove dependencies on the variable which caused the bug (questionId === ???)

Replace the conditional logic with a hashed array tree of all states (https://en.wikipedia.org/wiki/File:HashedArrayTree16.svg)

Use that array to generate other arrays of actions (function calls) and metadata (HTML/CSS)

Reference those in templates rather than using conditional logic

Limit code to declarative and interrogative array methods:

  • declarative

  • from

  • keys

  • map

  • reduce

  • filter

  • imperative

  • some

  • indexOf

  • every

References