Clever code considered harmful
This is one of those advice that sound reasonable when explained in the abstract, and yet when you hear it invoked in actual code reviews by other people, you wish it had never existed.  Especially when the following kind of constructs get decried as &quot;clever&quot;:<p>- writing &quot;return condition&quot; instead of &quot;if condition then return true else return false end&quot;<p>- using the conditional-value (&quot;ternary&quot;) operator in any capacity<p>- early returns&#x2F;goto cleanup instead of nested if conditions<p>- using basic higher-order functions like map or reduce in any capacity<p>- any kind of metaprogramming whatsoever<p>One person&#x27;s &quot;clever&quot; is another&#x27;s &quot;elementary&quot;.  If you want to point out that some code is hard to understand, that&#x27;s fine.  But don&#x27;t call it &quot;clever&quot;.  Using &quot;clever&quot; as a criticism is implicitly an ad personam argument, passing value judgement on the person who wrote it (&quot;Oh, they must have written it to show off&quot;) instead of an argument about the code itself.<p>Also, this:<p>&gt; Hi friend! Hope I didn&#x27;t startle you. Can I let you know about my newsletter?<p>is missing a &quot;fuck off to hell, don&#x27;t you dare disrespect my attention like that ever&quot; button.