Ask HN: How do you personally diagram code?
How do you personally diagram code so there's enough detail, but you aren't constantly getting lost in the formality of the system?
How do you personally diagram code so there's enough detail, but you aren't constantly getting lost in the formality of the system?
- context diagram for an overview
- uml sequence diagram for a more detailed view of interesting parts
- entity relatioship model for databasesPetri nets have formal semantics easy enough to grasp (firing rule) and provide enough optical cues to make them readable at a glance.
With a little practice, nets can be visually appealing, which helps in presentations and publications. I use Inkscape as a drawing tool.
Personally I prefer typing to drag-and-drop so I use https://www.gleek.io/
Check templates and turials, or ask me if you like to know more ;-)
But I've used Microsoft Visio in the past and it's a really nice solution (this was 3 years ago, so it might be better/worse now).
Component diagrams and deployment diagrams for the general overview, architecture and operations-wise.
Communication diagrams for some workflows.
Sequence diagrams to show how operations are executed.
For onboarding, sometimes a class diagram or two.
- diagram for high level
- diagram for small complex things
- comment on code as necessary
- write good enough documentation that is enough to onboard people to the project structure
- write decent commit messages