by kibwen · 2y ago · 0 comments
If I were to suggest a way to make the original chart cleaner without changing the quantity of explicit nodes and branches, I would start by reducing it into parts that are cyclic and parts that are acyclic, then drawing clear divisions between those parts. Then you could give these encapsulated bits names and thereby make it easier for them to refer to each other (such as in the duplicated flows between local and global preferences) without having to draw a mess of crisscrossing lines.
This will vary on the language in which it is implemented, right?
It kind of does though, because it's easier to understand what the system does in general without necessarily wanting/needing all the lower level detail.
That's also one of the reasons we use functions, instead of unrolling everything into a big ball of code, no?
Which is fine for someone working a job that doesn’t need to understand all the stuff behind the curtain, but not fine for anyone who actually wants to understand the overall system.
It's a representation. The actual thing will still have the whole complexity.
What is reduced is how much complexity we take in when looking at what the thing does. When someone wants to get an idea of what the thing does, as opposed to getting into the minutiae of every subcase, such a high level view is a better fit.
The original diagram does this too - it has an "A && B" node.
You generally write `if a and b { foo }` not `if a { if b { foo } }`.