UML- Useless Meaningless Lousy?


Tuesday, July 5th, 2011 - By Novita Mayasari

UML LOGOIt is easy to find numerous negative sentiments about UML. The main complaints seem to revolve around UML being of little practical use and inconvenient to draw and update.

I have been looking into the practicality of UML and find this answer on stackoverflow very interesting:

Using UML is like looking at your feet as you walk. It’s making conscious and explicit something that you can usually do unconsciously. Beginners need to think carefully about what they’re doing, but a professional programmer already knows what they’re doing. Most of the time, writing the code itself is quicker and more effective than writing about the code, because their programming intuition is tuned to the task.

My question is: Is it all that bad to walk while looking at your feet? It is often said that learning to walk is one of the hardest skills a person has to learn. However, in time walking doesn’t seem like a “learned skill” anymore because we do it so much that it seems natural. But what happens when we are walking along a tricky path strewn with pebbles, banana-peels and the like; wouldn’t we feel safer to look at our feet as we walk?

The same goes for programming. Overtime, coding becomes second nature. The inherent danger is that we are prone to stumble if we don’t look at our feet as we walk.

We do need to look at our feet as we walk because we need to be confident of every little detail of the code, yet at the same time, we also need a bird’s eye view to keep an eye on the structure of the code that we are trying to write. This is where UML comes in. UML to a programmer is like a map is to a traveler. It prevents us from getting lost when we are reading or writing a code. It reminds us of the big picture even as we are caught up in the nitty-gritty details of coding and implementation.

Personally, the main “problem” I have with UML is the current UML tools that are available. I am not going to rant about the tools in this post because I think Guy Wiener has done a very good job at it here, here, here and here. In a more recent post, Tim Benke also agrees that “all the solutions (UML tools) lack either in functionality or ease-of-use”.

Sadly, since the above mentioned complaints are associated with UML, overtime people tend to label UML itself as “bad”. Don’t you think that’s a great injustice to UML? We shouldn’t blame UML for the lack of a “perfect tool” to help us make UML diagrams.

Remember that the main purpose of UML is communicating the design and the structure of the code visually. It is after all, a modelling language. Moreover, almost everyone in the software development industry knows how to interpret UML and the fact that it is not language specific adds another edge to it. Certainly, UML does serve its main purpose well.

I believe that what we really need is a more intuitive, easy-to-use tool that can achieve this end in a way that is consistent across programming languages and remains true to the UML standard.

 

17 Comments

  1. Eduardo says:

    When you walk watching your feet you tend to bump into other people and immovable objects … painful.

    UML, as well as all the other diagramming conventions, are useful in “thinking” through designs and architecture and all those big picture things. Unfortunately, once you start coding, your understanding improves further and thus outdating the diagrams.

    Personally, I prefer to write blocks of comments and keep them updated. That way, I don’t have to jump around to keep code and documentation in sync. These days, there are numerous tools which will extract tidy documentation from suitably formatted comments.

    • Vineet Sinha says:

      Great point about bumping by looking at your feet too much.

      I do agree that once you start coding your understanding improves and you don’t need the UML as much. But isn’t that just similar to moving into a neighborhood and noticing that don’t need a map for the neighborhood – and that you would want a map for other parts of your city?

      Oh, and regarding documentation and diagrams getting outdated. I completely agree. Most UML tools are absolutely horrible at helping there. Perhaps that is more of a function of UML tools being bad vs UML being bad.

      • Mariusz Lotko says:

        “I don’t need UML” say programmers who _write_ code. Surprisingly, I can’t hear similair voices from those who have to read that written code and maintain it :-)

        Other words: you don’t write documentation (draw UML diagrams) for yourself. You do it because someone else will have to read it, understand it and fix or extend it. Since picture is worth more than 1000 words in most cases, UML seems to be perfect choice.

        • Agreed Mariusz,
          Diagrams may be the perfect choice for these cases but what still keeps the developers from using is the inherent issues in creating the right kind of diagrams quickly and then being able to maintain the documentation throughout the development process. And the current tools available don’t really do a great job in that.

  2. Stjepano says:

    Full UML can be to cumbersome to express the design and the structure of the code visually, also, it can significantly delay coding phase.
    Personally, I recommend subset of UML and written document that describes general principles of the design.

    • Stjepano,
      I agree, creating detailed UML diagrams for every aspect of the project is cumbersome and to some extend non-feasible. But creating and maintaining the subset of UML and the document describing the general principle can become tedious as the project grows. So we need a generation of UML tools which would bridge the gap between maintaining the documentation being solely the responsibility of the developer to be more tool dependent though with some input from the developer.

  3. Jordi Cabot says:

    In my view UML is neither good or bad. UML is just a notation and so it depends on how you use it. If you suffer from a “UML fever” (http://queue.acm.org/detail.cfm?id=984495 ) it may be hamful but when used correctly several studies have shown that brings plenty of benefits (just to mention one: http://modeling-languages.com/does-software-modeling-pay-empirical-studies-uml-presentation/ )

    • Vineet Sinha says:

      Jordi, I complete agree that UML is neither good nor bad – it depends on how you use it. I also do agree with UML fever.

      I think those of us with successful experiences with UML need to emphasize them and work harder on showing developers how they can get quick benefits with minor time investments, before we push teams to make deeper investments in a modeling language.

  4. Cal Enti says:

    This statement is astounding in its ignorance – “Beginners need to think carefully about what they’re doing, but a professional programmer already knows what they’re doing.”

    Maybe there’s a place where this is true but in my experience most severe errors, the hard to find and fix errors, are not introduced by beginners but so-called professionals (not all, but many). They don’t get the same oversight (as they tend to be senior and/or have stronger verbal combat skills) and tend toward self-confidence to the point of hubris. They also like to use shortcuts and pound the square peg into the triangular hole.

    The mistakes beginners make are generally along the lines of doing too much work; slavish devotion to patterns, not understanding the API so they write functions which duplicate those in the API, inappropriate cut-and-paste. They can and certainly do have bugs, but their bugs tend to be, well, beginner bugs and so robust code review can spot those.

    Much, more damage in terms of scope and severity is done by “professionals” as opposed to beginner.

    • Novita says:

      Yes, I agree. Over time, many professional programmers tend to be ignorant as they become more and more confident of their own code and this results in oversights and errors. But beginners do have their fair share of the damage that they can introduce to a project.

      The main point is in the similarity between professionals and beginners when they are new to a project. They have to start from zero to understand the project before they can start contributing. To do this, they will need some kind of documentation or API for onboarding. I think that if people start to believe in the practicality of UML for code review, less “damage” will be committed by both professional programmers and beginners.

  5. TY says:

    I like this words: “Remember that the main purpose of UML is communicating the design and the structure of the code visually.”
    However, I don’t very agree that “UML to a programmer is like a map is to a traveler”, I like this: the models in UML to a programmer is like a map is to a traveler

  6. TY says:

    I am not sure the purpose of UML just is “communicating the design and the structure of the code visually.” (or whether it’s accepted by OMG) but I think, to hold a small and exact purpose is a good idea. For example, the USE CASE is able to capture business process or business situation, but we would need more suitable tools in many cases, such as for business analysis.

    • novita says:

      The OMG website states that “UML helps you specify, visualize, and document models of software systems.” -http://www.omg.org/gettingstarted/what_is_uml.htm

      But yes, you are right, I guess it is my own inference when I said that it is the main purpose.

Leave a Reply