Clear is better than clever [pdf]
It&#x27;s interesting that the comparator function is one of the examples, because that&#x27;s something which shows how people often confuse <i>verbose</i> with <i>clear</i>; I think it&#x27;s best written in a single line:<p><pre><code>    return a &lt; b ? -1 : a &gt; b ? 1 : 0;
</code></pre>
That&#x27;s one line, compared with the 10(!) of his proposed method using a switch statement. Having worked with some &quot;modern&quot; codebases, I think verbosity is a bigger problem that&#x27;s become especially prevalent recently, since the idea of making a simple thing simple is so enticing and easy, but emphasising &quot;micro-readability&quot; to that extent (that&#x27;s 10 lines of code for two simple decisions) will bloat the code and make &quot;macro-readability&quot; harder, and it&#x27;s the latter that really matters for the understanding of complex software.<p>Anyone who has the experience of reading lots of highly trivial functions like those, and gotten the feeling &quot;I&#x27;ve read a <i>lot</i> of code, and I understand what each little bit does, but what is the whole thing trying to do?&quot; That&#x27;s a symptom of excessive verbosity.<p>To offer another (subjective) point, I think the lack of semicolons or other statement delimiters does make code harder to read, as it makes it look similar to a run-on sentence. Natural languages have punctuation for a similar reason --- you can quickly scan over sentences by finding their delimiters.<p>Also, the counterargument: <a href="https:&#x2F;&#x2F;www.linusakesson.net&#x2F;programming&#x2F;kernighans-lever&#x2F;index.php" rel="nofollow">https:&#x2F;&#x2F;www.linusakesson.net&#x2F;programming&#x2F;kernighans-lever&#x2F;in...</a>