Ask HN: How do you personally diagram code?
12 コメント
- context diagram for an overview
- uml sequence diagram for a more detailed view of interesting parts
- entity relatioship model for databasesAh so you have multiple different diagrams for the same domain? I've been trying to do everything with one, which might be the problem.
I use Petri nets. They allow me to diagram communicating systems, making explicit how active components (like functions or services) and passive components (like storage or i/o-devices) interact.
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.
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.
I use https://monodraw.helftone.com. A good example of how to make exceptional diagrams is brandur's blog [0].
[0]: https://brandur.org/postgres-reads
[0]: https://brandur.org/postgres-reads
I use mostly Entity-Relationship for designing a database, and UML Class diagrams.
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 ;-)
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 ;-)
I default to https://www.diagrams.net/.
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).
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).
I use mostly UML.
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.
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.
Combination of things
- 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
- 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
Take a look at https://diagrams.mingrammer.com/
How do you personally diagram code so there's enough detail, but you aren't constantly getting lost in the formality of the system?