Live data from Hacker News

Ask HN: Why aren't code diagram generating tools more common?

news.ycombinator.com

81–90 of 112 posts

Re: Ask HN: Why aren't code diagram generating tools more common?

#81
I think the problem is much harder than we think it is. In my experience, when you "hand build" a model of a codebase, either in your head, in your head plus notes, or in an actual diagram, you make *a lot* of executive decisions: what relationships you focus on, at what level, whether to include implicit or dynamic relationships, etc. None of this is easily automatable, and some might be virtually impossible to.

Compare that to something like a call graph, or a module dependency diagram. The last will be more complete, but will convey *much less* information than the later.

This varies with technology, some will be more friendly than others to this kind of tool, I think that the more dynamic, the worse, but even in very static and consistent language, I would not bet on any tool being better than the brain's parser for a long time.

Re: Ask HN: Why aren't code diagram generating tools more common?

#82
At one time I had a diagram of our database schema. Every table with its columns and data types was in its own now with arrows indicating foreign key relationships. Each table was color coded and then then grouped into related areas of concern (user tables over here, retailer tables over there, etc.) We had our print shop print it out at the largest size they could (about 3x5 feet) and hung it on the wall. We referred to it all the time, but it was a pain to maintain as the schema changed and overtime it became too much of a hassle so we stopped updating it. I think the same thing would happen with a system diagram. It sounds good and is helpful, but over time it won’t be maintained and will be abandoned.

Re: Ask HN: Why aren't code diagram generating tools more common?

#83

At one time I had a diagram of our database schema. Every table with its columns and data types was in its own now with arrows indicating foreign key relationships. Each table was color coded and then then grouped into related areas of concern (user tables over here, retailer tables over there, etc.) We had our print shop print it out at the largest size they could (about 3x5 feet) and hung it on the wall. We referre…

Theoretically a proper tool would be able to generate this on the fly - lots of tools to do this on the database side. I’m not aware of many good tools that can do this on the application side - perhaps someone can chime in with some platform specific examples?

Re: Ask HN: Why aren't code diagram generating tools more common?

#84

At one time I had a diagram of our database schema. Every table with its columns and data types was in its own now with arrows indicating foreign key relationships. Each table was color coded and then then grouped into related areas of concern (user tables over here, retailer tables over there, etc.) We had our print shop print it out at the largest size they could (about 3x5 feet) and hung it on the wall. We referre…

Yeah.. in a world with infinite time and no compromise, documentations + diagrams are nice. In practice, working on this means not working on something else, potentially more important. Trade-offs are hard and not fun :(

Re: Ask HN: Why aren't code diagram generating tools more common?

#86

Earlier quoted context omitted.

Protect against screenshots? Could you elaborate please

I believe the parent commentator is referring to how screenshots of a diagram generated at build or runtime are almost always out of date. It’s better to generate a diagram as needed than to archive an outdated artifact that could lead to confusion.

We just treat them as any other artifact, a plantuml job builds it and it gets published under a certain URL.

Re: Ask HN: Why aren't code diagram generating tools more common?

#88

I think UML (etc...) was one of those things that look great on the surface but once you start diving deeper all the problems hidden under the surface become overwhelming. If a thing has been tried many times in the past and even with a lot of money thrown at it, yet it still disappeared into obscurity, then it's a pretty good sign that the idea wasn't great to begin with. In practice it's the same problem as "noodle…

Plus, if it's as much work to create a diagram as it is to do much of the programming (not to mention maintaining it), you're just not going to do it.

One type of diagram I have found to be truly useful, though, is the sequence diagram. I needed to integrate someone else's library into my application, and having this was a huge help.

If anyone has a pointer to a good sequence-diagram generator (that runs on Mac, preferably), I'd be happy to hear about it!

Re: Ask HN: Why aren't code diagram generating tools more common?

#89

Something like this? NDepend Dependency Graph https://www.youtube.com/watch?v=23fBxM2v22k

Thanks for this, I'll have to try it first but this looks like exactly what I hoped for (it's a shame that it is only for .NET and Visual Studio though)

Re: Ask HN: Why aren't code diagram generating tools more common?

#90
Because no one has created a good enough one yet. Maybe you can. I am in desperate need for something like that and often just write diagrams on a piece of paper for code paths I am trying to understand or debug. Many things were just ideas for decades until someone figured out the right way to do it. This is one of them. You'll know you're close when coding with the diagram is faster/better/easier than without.
Post reply on HN