What is good/bad code? An illustrated example for non-programmers

<p>I once read a quote somewhere that basically had the following content:</p> <blockquote> <p>&ldquo;The lives of many people in the modern world depend on software, such as that which controls flight systems in large commercial airliners, and yet the field of software development is mostly unregulated. Anybody can become a self-taught software developer, and there are none of the certifications or rigors in place as there are for other high-stakes professions, such as sky-rise architecture or neurosurgery. It is a&nbsp;<strong>dangerously unregulated field</strong>, as a few lines of&nbsp;<strong>bad code</strong>&nbsp;could literally cause a loss of life, depending on the circumstances.</p> </blockquote> <p>I seem to remember that this was in some kind of mainstream publication. The theme of the article, I guess, was &ldquo;<em>Watch out for bad code, it can kill you, oh, but wait, it&rsquo;s invisible so never mind!</em>&rdquo; Certainly a soothing message for readers, don&rsquo;t you think? Seems in retrospect that the article was simply trying to sensationalize the lurking presence of &lsquo;bad code&rsquo; in the airliners, trains, and self-driving cars that increasingly surround us, and thus increase readership.</p> <h1>So what is &lsquo;Bad Code&rsquo;, as a layperson?</h1> <p>As a person who writes, reviews and&nbsp;<em>refactors</em>&nbsp;code (meaning,&nbsp;<em>to re-write in a more concise and usable fashion</em>) for about 5 hours a day, I know what code is (and what bad code is, believe you me!). I sometimes lose sight of the fact that many people<strong>&nbsp;don&rsquo;t</strong>&nbsp;have a concept of what code is.</p> <p><a href="https://medium.com/@todbotts.triangles/what-is-good-bad-code-an-illustrated-example-for-non-programmers-1222b600a0f0">Website</a></p>