Does anyone still use UML diagrams?

I'm a senior software engineering student at a medium-sized private university. One of my last classes was called "OOP: Design Methods." In it, we covered Boundary-Controller-Entity architecture (30%), Visual Basic (oh god, 20%), and UML diagrams (50%). I did well in the course, but couldn't help thinking that UML diagrams are clunky as shit. Being a student, though, I try to avoid developing too much of an ego, and I want to keep an open mind.

At my internship, my boss (who's an adjunct at my university) is a lot more current, had his last class working with Node, Angular, Mongo, as well as a mix of slightly more traditional technologies (MySQL, Python+Django, etc.) Because of his position, I have a lot of flexibility to learn and be self-driving at my internship, and I notice one thing. In almost every open-source library that I'm looking at (a lot of NPM and PyPi), I'm noticing a complete lack of UML documentation. Instead, what I see are automated tests, so I've been exploring TDD/BDD and learning a lot more about it. One particularly eye-opening comment said something to the effect of "...With proper TDD, the need for UML or other diagrams is obsolete. Done correctly, the tests themselves are the deliverables, and match the code much more easily than externally-generated diagrams."

So I'm wondering, are there any big bastions of traditional design where UML diagrams are still a big thing?

tl;dr: Student thinks UML diagrams are clunky, notices lack of them any many modern projects. Wonders if they're dead. Weigh in.

Posted May 30, 2015, 6:07 PM UTC

1622
SkippyDeluxe•

I have never even seen a UML diagram outside of classwork.

14
amaiorano•

At work I often have to sift through very large C++ code bases. I've found it helpful to quickly draw class diagrams on my sketch pad as I read through the code. It helps me to see the relationships between the many classes. I sometimes use these diagrams to help others understand the same thing. But this is very informal.

When it comes to designing a new system, I sometimes draw a quick class diagram mostly to share the idea with others. But usually I have a mental model of what I want to achieve, and start coding, letting it grow organically. It's very hard to get your on paper design right before actually coding it, at least in my experience.

5
daphosta•

I use them the same way. very informal and for personal understanding while reading code.

3
abutterflyOP•

This I can understand,and the above case with FSMs, makes perfect sense. In fact, I'm impressed with anyone's ability to code a project of even moderate complexity without some form of visualization, just to get ideas down.

Your experience seems similar to mine. Is a generalized diagram of how classes interact good to have? Absolutely. Should I give a damn if not every class member is listed there? Not at all

1
amaiorano•

Yeah, in fact these class diagrams are mostly useful when a system is poorly designed. At one point I mapped out the class diagram for a terribly designed memory system on my notepad, then ended up uploading a pic of it to our wiki because many of my peers were trying to understand it. This screenshot of my scribbly UML became the goto doc for that system ;)

5
abutterflyOP•

Hahaha that is magnificent.

1
Berberberber•

I think UML has the problem that, at the point where things are complicated enough that you need to visual the relationship between classes/objects/tables, it is also too complicated for the UML diagram to be intelligible. There is also the problem that some things that can be declared in UML that are extremely difficult to enforce through program logic (consider a polygon with a 3..* multiplicity of points).

On the other hand, I suspect UML diagrams figure strongly in CS and informatics courses because they are a more comprehensible way to explain properties, object references, inheritance, and relationships to people that have never encountered these concepts before.

5
fingerofchicken•

They are great for whiteboarding up ideas in the conference room, but limited to the idea or feature at hand rather than the entire app.

One reason you've probably never seen one in industry is because people tend to just dive in and hammer out a big ball of mud rather than architect anything.

5
KZISME•

This is basically what I was going to say :D

1
tjgrant•

I use a program called "yworks yEd" to do control flow diagramming (planning out logic in functions or state machine architecture), and that's about it. But I find it incredibly useful when I need it.

I think whoever came up with UML realized that it was really necessary to have diagram designs in programming, but I'm not sure they applied it to the right problem.

4
amaiorano•

Ah yes, for state machines, (UML) diagrams are very useful, especially for hierarchical (nested) state machines.

3
abutterflyOP•

Was just about to say the same.

2
Auteyus•

Business Analysts still use them. It's an easy visual for them to explain the more technical side of someone else's work.

3
JesusWouldVoteYes•

I've never found anything more complicated than a directed acyclic graph (DAG)/mutually exclusive conditionally exhaustive (MECE) diagram/mind map practical. About 15 years working in dozens of projects in a few countries.

2
abutterflyOP•

Heh. And even for a DAG that makes sense.

Most complicated thing I've seen was this state diagram for Android's MediaPlayer class: http://developer.android.com/reference/android/media/MediaPlayer.html

2
JesusWouldVoteYes•

Okay. I stand corrected. It doesn't have to be acyclic. :)

2
AllMadHare•

I use very vague UML type stuff for mapping out designs early on in a project. Sometimes you don't see obvious issues until you're staring at it. I mostly use it for designing data structures rather than software though, a good data diagram can save a lot of fucking around later on.

In a production sense, there doesn't seem to be a good case for maintaining a UML diagram for a big project, it can be useful for refactoring legacy code, but sometimes a match and a can of gasoline is good for that too.

There is still one place you do see UML, and that is design pattern documentation, which is something it is really good for, describing code concepts.

2
ch0dey•

Same here. Boxes with class names and method names on a whiteboard with a bunch of spaghetti between them. It works well enough, though.

1
AllMadHare•

Look at fancypants here with their method names.

Yeah, sometimes I just like to see on paper what i'm about to do. Plus I have a habit of coding til I pass out so it means when I wake up I can see what I was doing (and also the terrible ideas I have at 4am)

1
I_Like_Spaghetti•

Yum!

0
Kazaan•

It depends of your way of thinking. A visual person, like me, use diagrams a lot (activity and class diagrams principally). But principally for formalize my thinking, refactor code...

However, apparently a lot of people doesn't find that useful....

1
kyllo•

UML is basically used for massive enterprise OOP projects (usually Java or C#) where there is a Business Analyst documenting the requirements, an Architect designing the solution, and Developers implementing the classes. It's a communication tool for when you have a big, slow-moving project in a big, slow-moving company with a very fine-grained division of labor.

1