3 ms·
I take YAGNI to mean not developing abstractions until you have enough use cases to back them up. If you don't have a reason now to make an abstraction, don't
by ninkendo 7y ago
I take YAGNI to mean not developing abstractions until you have enough use cases to back them up.
If you don't have a reason now to make an abstraction, don't do it yet. Wait until you have at least 3 use cases where you're repeating yourself before you come up with an abstraction that collapses them. You'll know better what the right abstraction will be once you have those use cases... any abstraction you come up with now is much more likely to be wrong. And a wrong abstraction is much worse than repeating yourself.
Of course, if this is the umpteenth time you've done the same CRUD app that wraps a relational database, go ahead and use the abstractions you know worked before, because in that case, you've already seen the use cases before and you have a better idea of what abstractions will work.