Ask HN: How do you personally diagram code?
UML is quite formal and involved. Drawing boxes with arrows on Lucidchart or Draw.io is easy, but the lack of detail is a liability when code gets complex.
How do you personally diagram code so there's enough detail, but you aren't constantly getting lost in the formality of the system?
12 comments
[ 2.0 ms ] story [ 65.3 ms ] threadBut 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
Petri 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 ;-)
[0]: https://brandur.org/postgres-reads