Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Premature generalisation is the second cousin of all evil.

The problem with DRY is that the cost of it being wrong in the future often isn’t accounted for.

Copy, paste, search, replace is underrated.

That said, it’s a balancing act. The right generalisations are great.



Search, replace it with a single call to unified method when there are more than enough repetitions in the code.

Probably people just call it 'Refactor'.

The requirement changes and you refactor it to meet requirement.

And that's all you need to do to avoid premature generalisation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: