Onboarding engineers to an unfamiliar codebase.
The first week is spent building a mental model that somebody already has. A diagram transfers it in an afternoon.
The situation
A new engineer joins and is pointed at a repository, a README written eighteen months ago, and whoever has time to answer questions. The information they need is structural, what the pieces are and how they connect, and none of the available artifacts present it structurally. So they read files, form a partial model, and validate it by making a change and seeing what breaks.
What to do instead
Generate the architecture diagram from the repository on their first day, together. The diagram is a prompt for the conversation rather than a replacement for it: the useful part is watching someone experienced correct it, because the corrections are exactly the tacit knowledge that never makes it into documentation. Ten minutes of that is worth a week of reading.
Then leave it behind
Export the corrected diagram into the repository. The next person gets the corrected version rather than starting again, and because regenerating is cheap it can be refreshed rather than rotting the way a hand-drawn diagram does.
Ask questions of it
Once the diagram exists you can ask what depends on a component before changing it, or what a request touches end to end. Those are the questions a new engineer has constantly and feels awkward asking repeatedly, and getting them answered from the code rather than from a colleague's memory is faster and more accurate.
Day one
Questions
Related
- Documenting Legacy CodeIncluding the newest kind of legacy code: what a coding agent wrote for you over several sessions that nobody has looked at as a whole.
- Architecture ReviewMost of the effort in an architecture review goes into producing the diagrams, and most of those diagrams describe the system as remembered rather than as built.
- System Design Interview PreparationThe diagram is the easy part. Interviews are decided by the tradeoffs you can defend when the interviewer pushes.
- Technical Design DocumentsThe diagram in a design doc usually gets drawn last, badly, because everyone is tired of the document by then.