3 ms·
There are infinite possible futures but only one now. Write the best possible code needed today. Anything else is premature abstraction. I do get the "what if
by kjksf 9y ago
There are infinite possible futures but only one now.
Write the best possible code needed today. Anything else is premature abstraction.
I do get the "what if" temptation, I just think it should be actively resisted.
- osteele 9y agoSee [YAGNI](http://wiki.c2.com/?YouArentGonnaNeedIt http://wiki.c2.com/?YouArentGonnaNeedIt). A helpful (to me) metaphor is that you're paying for an option. (In the finance sense, not the type system sense.) Sometimes it's worth buying an option, sometimes it's not, but don't think it's free.
- astrobe_ 9y agoA more simple analogy: it's an insurance. It's certainly wise to subscribe an insurance for your house, but for every single drinking glass you own...? If it's a tea set you inherited from your great-grand-mother, when you break it the insurance won't un-break it. If your property suddenly needs to be more than a property, chances are that this change will break the LSP or trigger a larger redesign anyway.
- MrBuddyCasino 9y agoThis not one of those instances though. The cost of having getters/setters is essentially zero, the potential downside can be big.