Status | 🚧 |
Tags | code-review , principles |
-
Always try to get familiar with the problem domain at least for some adequate time period before asking questions (make an initial investigation, check existing codebase, find confluence pages, read the docs, prepare a list of concrete questions, etc).
-
Try to predict possible edge cases by yourself (you don't need to implement all of them, but you should be aware of the probability).
-
Do not commit if it does NOT work.
-
Do not commit if it works, but you don't know how.
-
Do not commit if you don't know how to debug.
-
Do not commit if you don't know how to test.
-
Do not commit any redundant code.
-
Do not commit if you are unsure is it really necessary.
-
Do not commit if your feature is not complete (except cases when it is under disabled feature toggle).
-
Do not commit if you haven't executed your code at least a couple of times locally.
-
Do not trust your IDE.
-
Do not trust copied/pasted code. Always analyze copied/pasted code, if it existed before, it does not automatically mean that it is perfect, it does not even mean that it works.
-
Do not commit a complex solution if you have no plans to support it.
-
Do not commit a complex solution if you are not going to provide any documentation for it.
-
Do not commit if you don't match the technical requirements.
-
Do not commit if you don't match the business requirements.
-
Do not commit if you are tired.
-
Avoid error shadowing.
-
Always log entry results.
-
Write small, simple, safe, straightforward, predictable, isolated, self-descriptive services as much as it is possible.
-
Write reliable specs that fail when the source is changed. Check different input combinations, e.g: zero, one, many, none, some, all.
-
Do not commit without specs.
-
Do not use git revert!!! Always prefer the creation of a new branch and cherry-picking into it.
TODO(marian13): Minimal example why not. -
If you are working with an old class, that was not covered by specs before, that does NOT mean, that you don't need to write new specs for it! Cover by specs at least your logic.
-
Express your intent inside code via naming, comments, links, docs, etc as much as it is possible.
-
Avoid spelling and grammar mistakes (Grammarly is your friend).
-
Always read the ticket description before code review.
-
Do not take code review comments too literally, they are not silver bullets. They can not be used as all-in-one solutions. For example, if someone asks you to remove the hardcode, it does not mean you have to do it all the time. Context matters! Think about it! Always!
-
When you can NOT follow any of the principles above for whatever reason - always provide an explicit explanation why in a written, visual form.