News for hackers. Stuff that matters.
Re:Sequence diagrams, the only good thing UML brought to sof... by Kwpolska on Thursday June 15, 2023 @02:43PM (#36344851)
Class diagrams feel pointless to me, this information works better as code, and how do you draw a class diagram with more than 10 classes and keep it readable?
Re:Sequence diagrams, the only good thing UML brought to sof... by johannes1234321 on Thursday June 15, 2023 @03:01PM (#36345031)
If you use class diagrams to show the "truth" you are in painland in my experience.

However I sometimes find them useful to extract key parts of the system and showing their interaction. Cutting away many attributes, many helper classes, many other things.

That can lead to pictures which are quick to grasp and then allow further digging based on code.

Re:Sequence diagrams, the only good thing UML brought to sof... by holoduke on Thursday June 15, 2023 @03:06PM (#36345084)
Maybe before you actually start writing code its nice to create some domain diagrams which you can convert to class diagrams. Saves a ton of time. And you have good discussions about the general high level workings of an architecture. Can be done on a whiteboard. Make some pics and start coding.
Re:Sequence diagrams, the only good thing UML brought to sof... by radicalbyte on Thursday June 15, 2023 @03:18PM (#36345211)
Assuming that you're using a modern IDE: it is an order of magnitude quicker to model the domain (classes + attributes) in code and project them as diagrams, say with graphvis.

High level boxes are great for thinking about systems but the key there is abstraction - minimal viable level of detail..

Re:Sequence diagrams, the only good thing UML brought to sof... by holoduke on Thursday June 15, 2023 @05:36PM (#36346854)
Dont you want to discuss and talk about a design before you even touch a keyboard? In my projects we always discus high level overviews with pen and whiteboards. Nobody should even dare to touch a keyboard.
Re:Sequence diagrams, the only good thing UML brought to sof... by radicalbyte on Friday June 16, 2023 @05:17AM (#36353691)
Absolutely, I pretty much always start with design sessions on a whiteboard (or if remote a call using draw.io).

That discussion is almost never going down the the level of an individual class and NEVER adheres to the UML standard.

Very occasionally I've had discussions about class structure by drawing class name + methods on a whiteboard but having the same discussion using Visual Studio's UML projection was just as effective.

Re:Sequence diagrams, the only good thing UML brought to sof... by TuringTest on Friday June 16, 2023 @02:08AM (#36352127)
If you're creating diagrams with graphvis, you're just coding on another language. The benefits of diagrams appear when you draw them by hand (or graphically by mouse).
Re:Sequence diagrams, the only good thing UML brought to sof... by radicalbyte on Friday June 16, 2023 @05:22AM (#36353732)
I generate them: initially with my own generator (which is copyright an employer from > 15 years ago), on a later project I found that Doxygen can do do that for you out of the box :-)

For interactive discussion I just use Visual Studio's projection, for databases I use the SQL Server Management Tool ERD projector or pgAdmin if I'm using Postgres.

Re:Sequence diagrams, the only good thing UML brought to sof... by TuringTest on Saturday June 17, 2023 @04:02AM (#36368253)
The point is that you're generating diagrams from code that's already been written, you're not modelling, do you? ;-)

Those are a different kind of diagram than the one you create from scratch to decide what goes in the program.

Re:Sequence diagrams, the only good thing UML brought to sof... by jxramos on Friday June 16, 2023 @02:54AM (#36352505)
this phrase caught my eye, "minimally viable level of detail", to which I immediately thought "minimal detail for a coherent thought". That's a cool concept actually I might hold on to and develop.
Re:Sequence diagrams, the only good thing UML brought to sof... by prepend on Thursday June 15, 2023 @02:50PM (#36344945)
I think class diagrams are a good way to visually display classes and hierarchy. If I have a package or module that has 10 classes and I want to show inheritance, properties, and methods I think it’s easier to show the class diagram then hand someone 10+ source files.

Also, class diagrams are more useful when you can’t give out source.

That being said, I think you can autogenerate class diagrams from code so it’s not like you should spend a lot of time making them.