by pavel_lishin · 13y ago · 0 comments
My experience is exactly the opposite. Every time someone's told me, "A user's account will only ever have one event associated with it", or "An order will only be paid for with one credit card" or "A credit card payment will only ever apply to one order", that someone is wrong, and it ends up costing us days to fix.
First Ryan's post says he's saying something similar, except it appears to be opposite to the post he's replying to.
Then you say you can't see the times where YAGNI helped you, but that's neither true literally and also in spirt. Literally because it wouldn't be YAGNI if you did actually need it. But more importantly I have often discovered some architectural choice or unused feature stubbed out from years prior that saved me a ton of time in the here and now.
http://news.ycombinator.com/item?id=5003341
My experience is similar to pavel_lishin's, and our experiences are contrary to the author of the article.
I hope that helps to clarify the first bit, anyway.
A somewhat unspoken but generally understood part of this philosophy is that while you don't go out of your way to make things super flexible, you also make sure you don't code yourself into a corner that will be hard to get out of should the requirements change.
Knowing how to balance this sort of thing well takes years and years of experience (IME) but it certainly isn't impossible.
As a side note, something taking "days to fix" is no big deal considering a big part of the desire to not over-architect is to avoid situations where a fundamental and ultimately bad assumption results in a situation that is going to take months to fix with the result being a mostly new and untested code base and all the pain that comes with that.
Aside from being an expert in abstraction, domain knowledge is also a key component to make these decisions. You're right that it takes years to become competent at it, and even then there's a good amount of luck involved.
> "An order will only be paid for with one credit card"
Perhaps there will be a request to allow payment in multiple parts for orders, so adding the generality from the start saves time. But perhaps instead the spec change is to allow payment of multiple orders at a time. Or partial payments of multiple orders. Or payment in foreign currencies and bitcoin. Or not paying orders at all, but marking them "completed" for accounting at the end of the year.
Altogether, it's not possible to correctly predict the future feature set of the project to decide on the correct places to add abstractions, unless you are really great at product design and can read the future minds of whoever is coming up with the requirements.