Good Practices
Debugging
- Even if it's seemed bad, often a
Printf
is quicked than a debugging tool
- Logging data is important: a debug mode should always be available for medium to big programs.
git-diff
is a good friend, that the first step to debugging
Fix issues
- When debugging
docker
run issues, if something_ vanishes, looking at the volumes
is a really nice practise.
- Take your time before reaching conclusions. Having a reproduce state of the bug is important.
Coding style
- The style is often subjective. However, it matters to stay consistent.
Coding methods
- Pencils and papers are your friends, feel free to fill a lot of them with notes, graphs or anything relevant: it frees your mind.
- A good way to design a good API is actually to try to explain it with documentation ie. always start by a .mli, give a few hints on the general idea behind the API and give a few explanations on how users are supposed to use it. Writing a few examples is always a good way to find the right function and types names and the proper API to compose them (quote @samoht).
DevOps
- NEVER DEPLOY on Fridays.
- If the code you deploy writes in the file system, try with a subset to make sure it has the correct rights.
Don't be a dummy
- Ensure you call the correct executable or library.
- Check if the features you want to test are activated.
Resources