Small functions considered harmful
During my earlier years, I would get into all types of dogmatic debates, such as <i>&quot;DRY-considered-harmful&quot;</i> or <i>&quot;small-functions-considered-harmful&quot;</i>. With experience, I&#x27;ve realized that such abstract debates are generally pointless. Any principal can lead to bad results when taken to an extreme, or badly implemented. Thus leading to people declaring <i>that-principal-considered-harmful</i>, swinging the pendulum to the opposite extreme, and beginning the cycle all over again.<p>Now, I find such discussions valuable, but only in the context of concrete examples. Devoid of concrete and realistic examples, the discussion often devolves into attacking strawmen and airy philosophizing. If this article had presented realistic examples of small functions that should have been duplicated and inlined, I think we can then have a much better discussion around it.<p>That said, I do have to offer a word of warning. It&#x27;s possible that the author is a good programmer who knows how to incorporate long functions in a way that is still clear and readable. Unfortunately, I&#x27;ve had the misfortune of working with horrendous programmers who write functions that are hundreds of lines long, duplicated all over the place, and are a pain to understand and maintain. Having short-functions and DRYness is indeed prone to abuse, but it still works as a general guideline. Great programmers may be able to ignore these guidelines, but at least it prevents the mediocre ones from shooting themselves (and others) in the foot.