A helpful code review mindset: "Will we understand why this line exists...
A helpful code review mindset: "Will we understand why this line exists later?"
If the answer is no, options to clarify intent:
1. Introduce a well-named variable
2. Extract a well-named function
3. Add a comment
4. Write external docs (mention in comment)
Oddly, this mindset can also impact the technical approach.
Example: We just extracted an npm script to a separate JS file so we could add comments to describe why it's useful and when to use it (since you can't add comments above scripts in package.json).