Skip to content

Instantly share code, notes, and snippets.

@chrisvfritz

chrisvfritz/.md Secret

Created November 29, 2018 19:26
Show Gist options
  • Save chrisvfritz/6e1bfccab04cb77280a732d4f86de9bf to your computer and use it in GitHub Desktop.
Save chrisvfritz/6e1bfccab04cb77280a732d4f86de9bf to your computer and use it in GitHub Desktop.

Unproductive code reviews

Arguments over style

Problems:

  • People feel demotivated
  • Lower productivity
  • Team doesn't grow

Solutions:

  • Decide what the convention will be (everyone votes, then it can't be brought up again for 3 months)
  • Lint EVERYTHING
  • Pre-commit linting with lint-staged, yorkie (fork of husky)
  • Run related unit tests on pre-commit (--findRelated with Jest)
  • Always find some room for improvement, even if it doesn't prevent the code from being merged.

Team not aware of conventions, or just not following them

Problems:

  • Someone not sure about the steps involved, e.g. to add a page
  • Not writing tests, when they know they should
  • Not following other conventions that can't be caught by a linter

Solutions:

  • Use generators with Hygen
  • Workspace snippets in VS Code
  • Internal docs (have new people read through your internal docs and ask questions, before getting a walkthrough)
  • In-line comments (but first, see if you could re-write the code in a way that doesn't require a comment)
  • Use Cypress for end-to-end tests (much friendlier dev experience)

People get hurt

Problems:

  • A new dev asked me once after a week of my code reviews, "Do you hate me?" because I always found areas for improvement. Now, that's not a problem - that's what helps the team grow.

Solutions:

  • Use a lot of emoji - it's better to come across as weird than mean
  • Ask questions, rather than assuming fault
  • Let nitpicks go if they won't ever result in a bug, difficult to figure out, difficult to maintain, very likely to require a major refactor very soon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment