Debugging
We should test our code iteratively to fing bugs early. A debugger like gbd can help with looking at the stack frame, assembly code, executing step by step and more.
Good Design of the code can help reduce errors. We should in general choose a style and stick with it throughout the code. Some good advice is:
- Choose meaningful variable names.
- Be consistent with camelCase.
- Keep comments precise and meaningful. Don’t explain akward logic, improve it.
- Use a version control system (like git) and write meaningful commit messages.
- Document your code.