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

Yes, this! Quite related... I forget where I heard it, but someone said the way you know you're talking to an expert is that their answers to a lot of questions start with "It depends...". Being an expert often comes down to understanding the nuance of when to follow standard practices and when it's better to violate them.

You went through YAGNI. DRY is the same thing. It's often very good advice. But there are certainly limits to DRY... calculating the area of a rectangle from its width and height in two different repositories in the same company probably wouldn't justify creating a library to be shared between them. There's a line somewhere in the middle. Being skilled at understanding what side of that line a given case should fall on is something we build with experience.

I think YAGNI and DRY are at their best as advice when they come packaged together, putting them in tension in order to prompt us to find the right balance and not to blindly follow either one. Taken together, they give us a framework for thinking about one set of tradeoffs. I believe the core of software engineering (and many other pursuits) is identifying the most important tradeoffs and finding a good balance among them. Blindly following advice can get in the way of that.



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

Search: