0

I hope that I have worked out this question enough for not being opinion based. I am not asking whether UML is good or bad, because I have no doubt that it is useful for those who work with it professionally.

I would rather like to know if there is kind of a critical mass (measured in, say, hours of coding per week) for UML tools to be useful for a lone hobby programmer.

Of course this assumes that my lack of success with UML is mainly due to lack of practice. If maintaining practice means spending 90% of my spare time with UML, without getting much working code, that's what I would consider an example of being "below critical mass".

By hobby programmer I mean: the typical source code size of my projects is below 1 MB. Sometimes I draw inheritance trees by hand, but that's it. I have got 35 years of programming experience and so just writing down code without an explicit design process (except for the usual OOP design principles and patterns of course) is my natural approach to a project and works quite well.

I have had some superficial contact with UML tools (Rhapsody, Enterprise Architect) in my job in the past, which is not primarily software development. For example somebody asked me once to model a mechanical concept in SYSML.

I know most of the language constructs and presumably also what they mean, but to be honest I don't really know how to use them for my benefit. It just takes so much time that doesn't feel productive. And what's more there is no direct feedback compared to coding some lines and just test them. Also when trying to use UML I have found myself in a situation several times, where the problem seems to become more complicated and over-designed instead of getting clearer. It is as though using the abstract language keeps me from seeing what's really necessary and relevant practically.

On the other hand I sometimes feel that I might be missing something by not using UML.

oliver
  • 2,771
  • 15
  • 32
  • I don't think there is any way this question could _not_ be regarded as opinion based. You will get other people's opinion and experience (which is essentially what you have written here for your own point-of-view). What is wrong with just trying it see if if has any benefits? – Clifford Mar 03 '18 at 08:15
  • @Clifford: yes, trying it is okay. However it also takes some time (probably a lot until I can make a definite decision). If somebody tells me from his experience he is spending 10 hours per week and it is difficult for him to keep up practice, that would already be helpful. – oliver Mar 03 '18 at 08:42
  • 1
    If this is truly for "hobby" programming - time is all you have. If you are coding for fun, don't do anything that is not fun. If your intent is career development, that is a different matter - that is no longer a hobby, but personal professional development. It is all still opinion. UML (or any other design notation) serves two purposes - 1) communication to other project stakeholders/developers, 2) Achieving a coherent and clear design in a manner that _can_ be difficult when hacking at the code-face. – Clifford Mar 03 '18 at 09:33
  • 1
    Unless you are intending to do complete end-to-end model-driven development you can stop generating UML at the point your intent becomes clear (in this case to you alone) and you have a road-map for development. That may prevent you going off piste and give you a way of determining development progress and completeness. Sometimes it helps to sketch out an idea in something other than code. The UML is one way of doing that, its benefit being that of well defined semantics and syntax, but that is only critical when either communicating to others or generating code from the model. Sill opinion. – Clifford Mar 03 '18 at 09:38
  • @Clifford: One thing I like to point out with regards to software and communication: you (today) will most likely also be communicating with yourself (in a year when looking at your own code and understanding nothing :-) ). I have just installed Enterprise Architect Trial and probably will try to use it for my current endeavor, following your opinion. Thanks! – oliver Mar 03 '18 at 09:44
  • 1
    EA is relatively inexpensive, but if you want zero cost, [Umbrello](https://umbrello.kde.org/) may serve. Not sure how good the Windows or OSX versiuon are; I previously used it in a Linux VM on Windows when it was Linux only. – Clifford Mar 03 '18 at 10:15
  • although this - as being a tool question - is a slight digression, would you say that Umbrello is still feature rich enough to be "almost" as useful as EA? If I take the effort of learning it, I'd rather not have hardly more than a drawing tool... Self-education with youtube and such is also a criterion – oliver Mar 03 '18 at 10:22
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/166140/discussion-between-clifford-and-oliver). – Clifford Mar 03 '18 at 10:47
  • I posted on that dreaded chat room (I probably could have sent it to the sink). – qwerty_so Mar 03 '18 at 12:05
  • @ThomasKilian: thank you :-). As far as I am concerned you could have also posted it as an answer if you told a little more about why you think it is overkill and what you consider larger projects (code size, # of classes). Have you got experience with UML in your job? How much time do you spend for your private projects per week/month? – oliver Mar 03 '18 at 12:14
  • 1
    I will eventually write a little summary, though I also voted to close this as opinion based... – qwerty_so Mar 03 '18 at 12:54
  • there's so many things here that are based on opinion and people just don't notice ;-) – oliver Mar 03 '18 at 12:56

2 Answers2

2

Here is my story: I have been working in the industry as a UML consultant and modeler for many years. Projects generally were large and a variety of UML's language was needed to model those projects. Without question, UML was effective and helped spotting issues in user/customer communication as well as solving coding issues. I'm also programming on a hobby base (e.g. I have built a program to manage membership and payments for our Shotokan club and also once had a few programs on the AppStore). These programs are somewhat around 7.5kloc Swift +- something. All of them were started from scratch without much design. And all of them now have a state where maintenance without proper (UML) documentation starts to get tricky.

Why not UML from the beginning? Well, like most programmers it's fun to start something and see a ROI quickly. And because you have it at hand while working on it you add feature after feature. And some time later you start missing ideas why you did things the way you did and how it works. Gnawing teeth for a moment, a few coffees later you get by and that will go on for a certain time. But then a bit later that does not help. And there's where I start re-documenting (at least parts) of the code. For Swift it's even harder as there is no usable RE tool and I have to create class diagrams manually.

So I just do class diagrams for the complicated parts to get an overview and doing the part where I got trouble in more detail. Starting from that I usually create a couple of SDs to get my grip on the issue - and that really helps a lot. Also, sometimes even during coding(!), I use state charts for certain cases. They are very handy when it comes to, say, parsing a DSL or things like that.

I'm not documenting use cases for my hobby projects. Simply because there are only very few and you don't have a customer to deal with.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • Very good account. Sounds a little like Programming Addicts Anonymous, but it helps me to see that I am not alone ;-) So you are using UML after the work/damage is already done? Interesting! That's one of the things I would like to do, but I don't know if the support for reversing by the tools is sufficient or you finally end up with something unusable/untested in the end. Anyways, your opinion helps me to see that DIY-UML might not be so far-fetched. Thanks! – oliver Mar 03 '18 at 14:23
  • Sometimes (but really only very rarely) I start designing before coding - for my hobby projects. When I learned programming in the mid 70's it was almost all just text documentation. If at all. Now I'm using UML since more than 20 years. – qwerty_so Mar 03 '18 at 15:04
  • Wow that's truly a lot of experience. I started programming in the home computer era around 1983 when I was 14, but I always enjoyed it so much that it took me long to understand why UML has its place. – oliver Mar 03 '18 at 15:18
1

It depends I think on how you yourself work on your projects.

Putting executable models aside, the UML is used for analysis and design work, mainly in software architecture and engineering (as you probably know). Being formal it is very useful for projects involving multiple people, who all benefit from speaking and understanding a common language in which complex software constructs are expressed specifically: Engineering (in any discipline) relies on the ability of engineers to cross-verify each other's logic and find gaps, the UML is one language set that software engineering has to do this.

The UML might also be useful for you alone to think through complex problems before cracking into code, or documenting ideas that you think you can't comment properly in your code. Like you, I've been coding for a while (since the 80s) and using the UML since about 1998. My profession now is in software architecture (thus I use the UML heavily) but I also still do a lot of coding - I often build proof-of-concepts and I have my own products, one being circa 250,000 lines of code (for that I have employed the UML at times and at others coded without a model depending on need).

One thing you might engage in better with familiarity to the UML is software design patterns. These are often documented (at least in part) using the UML since implementation can vary across programming languages whilst the pattern concepts and structures are common.

A bit of a ramble but I hope this helps in your quest.

muszeo
  • 2,312
  • 9
  • 13