Avoid Indirection in Code
It&#x27;s not <i>indirection</i>, it&#x27;s <i>bad abstraction</i> that&#x27;s the real issue here. Consider the example used in the article:<p><pre><code>    if x.startswith(&quot;foo&quot;):
      do_something_with(x)

    if is_foolike(x):
      do_something_with(x)
</code></pre>
The problem with both of these variations is that the &quot;if-statement&quot; doesn&#x27;t have any meaning behind it. There&#x27;s no gain in the indirection presented here. Whereas the following code has meaning:<p><pre><code>    if checkHasPermissions(x):
      do_something_with(x)
</code></pre>
The reader of the function is now able to understand the <i>purpose</i> of the indirection and the function has clear responsibilities.<p>Remember although code is interpreted by machines it&#x27;s <i>read</i> by humans...