Applying the Linus Torvalds “Good Taste” Coding Requirement
I was given a piece of advice very early on in my career that I&#x27;ve always been grateful for, which is fundamentally the same as this.  IF and FOR are both code smells.<p>One case of this is just simplifying loops with some functional goodness<p><pre><code>  var listOfGoodFoos = new List&lt;Foo&gt;();
  for(var i = 0; i&lt; listOfAllFoos.Count; i++)
  {
     if(listOfAllFoos[i].IsGood)
         listOfGoodFoos.Add(listOfAllFoos[i]);
  }
  return listOfGoodFoos;
</code></pre>
VS<p><pre><code>  return listOfAllFoos.Where(x =&gt; x.IsGood);

</code></pre>
But perhaps a more interesting point is it can also be a a sign of DRY gone wrong - two things that aren&#x27;t actual repeats of each other, but just similar code, are smushed together with lots of IFs hang around to make it actually work.<p>A connected piece of advice was &quot;it is easier to push things together than pull them apart&quot; so err on the side of assuming two bits of code are not the same, knowing you can refactor them together later (probably only a few hours later) if it turns out they are in fact pretty similar.