News for hackers. Stuff that matters.
Re:UML: My Part in Its Downfall by iLoveOncall on Tuesday October 04, 2022 @04:45AM (#33077861)
So you have an issue with class diagrams, not UML.
Re:UML: My Part in Its Downfall by captainmuon on Tuesday October 04, 2022 @06:02AM (#33078274)
Well, I take issue with most formalized diagrams that represent code elements, rather than "business" entities. It leads to a kind of thinking that is wrong IMO, where you mechanically represent every business object by a class, say Customer and Employee.

I tend to think of OOP as a way to rewrite 'if's now. When you have the same huge 'if' or 'switch' in a couple of places, you can usually rewrite it to use polymorphism, and it becomes clearer. But it is totally fine to use procedural or functional idioms most of the time.

I don't know the whole breadth of the actual standard UML, and I don't know anybody who does. When I say UML, I mean as practiced and not as written, and that means: Boxes for classes, methods below, various kinds of arrows that I have to look up. For sure there are good parts in the standard, but that is not really relevant here.

As the sibling comment says, sequence diagrams are usually more useful. Or state machine diagrams. Or a diagram showing data dependencies.

Re:UML: My Part in Its Downfall by HelloNurse on Tuesday October 04, 2022 @08:47AM (#33079517)
Then you are not complaining about UML, but about the old school bad OO designs that UML is meant to support (along with old school good OO designs).

Without UML, such designs would be worse because they would be less documented: if you have a relatively concise class diagram in front of you it's easier to ponder about what each of the arrows and boxes means.

Re:UML: My Part in Its Downfall by littlecranky67 on Tuesday October 04, 2022 @05:20AM (#33078077)
Sequence diagrams are not particularly helpful with JavaScript and alike and agree with parent OP that its too strictly tied to C++/Java. They are just not intuitive with async/await and function composition. Yes, one can always do "mental translation" to translate those into the diagram and vice versa, but just not helpful. Now one would argue that you model "more abstract processes" with them, but there are better modelling languages for business and network processes.
Re:UML: My Part in Its Downfall by sethammons on Tuesday October 04, 2022 @08:27AM (#33079323)
If I were reviewing a system design, yes, with js, I'd still like a sequence diagram. I'd just indicate that ordering may not be exact between certain bands of requests. I model concurrent systems all the time in sequence (ish) diagrams.

I want to know that action X will trigger N calls and those calls call service foo and bar, and that foo then calls out to its data store and eventually returns something and service bar calls services raz and quux and those each fist call a caching service before going to their data stores. All requests eventually return (in the happy path). Now, as a reviewer, I can quickly see what talks to what and why that call happens and I can ask more intelligent questions like what happens if a cache hit happens when the data store has been updated.

What do you prefer?

Re:UML: My Part in Its Downfall by marcosdumay on Tuesday October 04, 2022 @12:59PM (#33083227)
Sequence diagrams are particularly useful for protocols, and not so for code in any language.

The fact that UML formalized them as a way to describe code tells you a lot about the standard's quality.

Re:UML: My Part in Its Downfall by rzzzt on Tuesday October 04, 2022 @05:00AM (#33077961)
Why is making the distinction important here?
Re:UML: My Part in Its Downfall by cassianoleal on Tuesday October 04, 2022 @05:05AM (#33077982)
Not GP but probably because of all the other UML diagram types, which are not bound to OOP at all.
Re:UML: My Part in Its Downfall by iLoveOncall on Tuesday October 04, 2022 @07:16AM (#33078802)
Because class diagrams are not even 10% of UML, and they are the most useless part of UML.
Re:UML: My Part in Its Downfall by Joker_vD on Tuesday October 04, 2022 @07:27AM (#33078889)
They, however, a) were pretty much the only actual UML's innovation: other things like sequence diagram have existed long before; b) had most emphasis put on them.
Re:UML: My Part in Its Downfall by rzzzt on Tuesday October 04, 2022 @09:02AM (#33079699)
I'd say it's getting a wide audience agree on a common method of notation. I have a Java book from 1999-2000 which uses OMT (all right, OMT's object diagrams) as its main representation. Not too far off from UML class diagrams, as it is also considered a historical predecessor, but still enough to make me consult the legend time to time.