Hacker News new | ask | show | jobs
by ehnto 1949 days ago
That wasn't complexity, it was repetition or verbosity. It's tedious to manage rather than complex.

In making it DRY you have introduced a dependency for all of the usages of that snippet of code, and made it harder to have individual uses deviate if they need to.

Of course that might be exactly what you want! It's just good to be aware that code reuse is adding complexity by way of adding a new system to manage.

A little function, no big deal. But if you find yourself writing models and extending classes just to save yourself a couple of repetitions you may have jumped off the deep end!