Ask HN: How Do You Handle Looking at Large Codebases?

1 points by worldsavior ↗ HN
I'm working on a few big projects, I'm experiencing a bit of uncertainty and forgetting what I did 300 lines back. How do you handle this type of situations where you need to read your own code or others when it comes to large ones?

1 comment

[ 0.26 ms ] story [ 14.5 ms ] thread
Divide your project into independent modules:

- So after you build a module, you only have to remember the interface to the module: what does it input? What does it output? You can forget about the implementation details.

- If you need to later fix a problem in that module, you only need to remember the interface to other modules it interacts with.

- Good self-documenting names and comments will help.

- It's like when you use 3rd party modules: you just need to understand the API it exposes, not the underlying implementation details.