Hacker News new | ask | show | jobs
by zabzonk 2312 days ago
In case you haven't gleaned it from the majority of comments here, flowcharts are a terrible way to describe code, particularly modern, multi-threaded code that uses exceptions. Don't go there.
3 comments

I quite agree. Unfortunately management wants single-threaded code and wants it documented with flowcharts. So right now there's lots (!) of clouds detailing "this calls into another API documented in another flowchart..."
To me, that screams "put your resume out on the street".

I mean, I'm not opposed to documentation. It's important. But if your management thinks that flowcharts are the way to do it, I wonder what millennium they think it is.

Indeed? Flowcharts aren't the only documentation. Swagger describes the API parameters, flowcharts describe the API code flow, and text provides a story, and comments in the code describe particulars.

Flowcharts are just where I've felt that I've significantly underperformed; where management has asked for more of them.

Putting my resume on the street is something I do often. Want to look at it?

If you think flowcharts aren't the way to describe code flow, then I'm curious what method you think is better.

Ah. Flowcharts were all you mentioned, so I assumed (bad move) that they were all you did.

Depending on what exactly you are doing, parts of UML might be better. It lets you describe different aspects with different diagrams, so that, if one kind of diagram is sub-optimal for showing some aspect of what's going on, another kind might be better.

This is because flow charts are two dimensional. What you need is a 3rd dimension to represent parallelism. These programs are better represented as 3d structures rather then 2d flow charts or even text.
3D. I like it. I think I agree.

The closest I've seen to anything that actually does that is UML. But it does so only by having multiple different diagrams. That's like having a drawing with a front view and a side view - it's not a 3D diagram, it's two 2D diagrams that you can use to kind of see what's going on in 3D.

I don't know of any good system of notation that does what you're asking, nor any software for drawing or viewing such diagrams. But I agree that 2D flowcharts don't represent parallelism well, and that 3D looks like a better answer.

UML is non-rigorous and has a whole lot of pointless incidental complexity. Intuitive representations of parallelism are fairly natural in data flow, but that is precisely dual to flowcharts; you can not represent both on the same 2D diagram without some very precise rules about what portions of the diagram are intended to represent each. Proof nets give you something not unlike this.
Oh, I never said UML was ideal. I merely said that, if you squint, you could see it as a clumsy, inadequate, and probably unintentional half-step in the direction of crimsonalucard's idea.
Obviously you don't like them, but flow based programming is pretty great actually.