top | item 37808399

(no title)

Loveaway | 2 years ago

The biggest pitfall is DRY imho. Write generic code, reuse abstractions. It's the most elegant way. Except it always tends to lead to these god classes, super systems, that try to be most flexible and to do everything. Then comes the point where it becomes impossible to understand all the interactions and half of your codebase falls apart if anything changes. All because you were to proud to copy & paste a few lines like it's a deadly sin.

discuss

order

pjbster|2 years ago

DRY also removes an easy opportunity to expose patterns which are things that people are incredibly good at recognising and internalising. I used to religiously apply DRY but now I prefer to leave repetition in unless the git log shows changes being applied to the repeated sections.