How to write code which is easy to trace

This is a really important skill that I try to coach any team I am managing on.

Programmers should be rewarded by how well they make their code easy to understand. Tracing is a fantastic tool in making that possible if one knows how to use it effectively.

The trick with tracing is to make sure that:

  • One separate concerns really well

  • And the files are small

  • And that if you yourself can do tracing effectively on the code you are running by tracing on one concern.

For instance - let’s say you are writing a grid infra-structure a good example would be to isolate the heart beat functionality in one file so it can be traced easily.

Â