<story><title>Flowcharts of programming language constructs</title><url>https://www.progsbase.com/blog/flow-charts-of-programming-language-constructs/</url></story><parent_chain><item><author>notacoward</author><text>Pretty neat. Three things that occurred to me while reading it.&lt;p&gt;(1) Makes it pretty clear why exceptions are even more of a control-flow nightmare than goto. What a messy graph.&lt;p&gt;(2) The &amp;#x27;defer&amp;#x27; diagram is a big WTF. Couldn&amp;#x27;t even figure out which box is supposed to represent which statement in the example.&lt;p&gt;(3) I&amp;#x27;d love to see a graph of the control flow when you throw in a few spurious lambdas like &amp;quot;advanced&amp;quot; C++ programmers tend to do (and similar in a few other languages). Might even make exceptions look good.</text></item></parent_chain><comment><author>bibyte</author><text>My takeaway was the exact opposite of yours. For example the goto graph seems very intuitive and simple. But it is much more complex to reason about compared to exceptions. My takeaway was that simple graphs like these can&amp;#x27;t really explain the pros and cons of high level programming constructs.</text></comment>
<story><title>Flowcharts of programming language constructs</title><url>https://www.progsbase.com/blog/flow-charts-of-programming-language-constructs/</url></story><parent_chain><item><author>notacoward</author><text>Pretty neat. Three things that occurred to me while reading it.&lt;p&gt;(1) Makes it pretty clear why exceptions are even more of a control-flow nightmare than goto. What a messy graph.&lt;p&gt;(2) The &amp;#x27;defer&amp;#x27; diagram is a big WTF. Couldn&amp;#x27;t even figure out which box is supposed to represent which statement in the example.&lt;p&gt;(3) I&amp;#x27;d love to see a graph of the control flow when you throw in a few spurious lambdas like &amp;quot;advanced&amp;quot; C++ programmers tend to do (and similar in a few other languages). Might even make exceptions look good.</text></item></parent_chain><comment><author>lwb</author><text>My impression was that the article made the exceptions graph much more complicated than it needed to be. Each function doesn’t need three boxes, and they don’t need to each throw exceptions twice. IMO exceptions are much cleaner in practice and are great for things like “kill this script” or “throw a 500 error”.</text></comment>