3 ms·
I realize this a click-bait title, and the article plus the discussion is more nuanced (this is why I love HN!). But I think less experienced developers might t
by dktoao 5y ago
I realize this a click-bait title, and the article plus the discussion is more nuanced (this is why I love HN!). But I think less experienced developers might take this as a license to just write pages and pages of spaghetti, then point to this article and say "Duplication is good!". Duplication is not good, it is the enemy of maintainability. However, sometimes under very complex software requirements (which hopefully aren't needlessly complex), there is no good abstraction and attempting to create one will just make your code confusing and inefficient. However, there are many things that you can easily abstract safely and practice doing this makes a developer better. If you are a junior developer I highly recommend taking this article with a huge grain of salt or outright ignoring it. Both an ill-fitting abstraction and duplication are going to lead to messy code, messy code is a fact of life, but only one of these practices is going to lead to good habits and help you develop as a software engineer (hint: it isn't duplicating your way out of problems).