https://github.com/97-things/97-things-every-programmer-shou...
1. check git blame in the place where you do changes before you do them - on several occassions I found out that the "obvious bug" I was fixing was introduced on purpose 2 years ago and the jira referenced in git commit explained why
2. don't refactor long pure methods into classes with many small methods - if you can refactor a method into smaller methods - that's fine, but if you need to introduce a class with internal state because of interactions between these small methods - DON'T. You give the caller the opportunity for many interesting bugs, race conditions etc.
3. when changing code look a few levels up and down the callstack and check if there are steps that are now redundant
4. it's much better to pass empty collection than null or optional
5. when you're testing conditional code - test the negative. For example when you add paging - don't only test that page 2 shows items from page 2 - also test that it doesn't show items from page 1