3 ms·
5 and 6 are super hard decisions. You never really know what your code will be used for in the future, especially not if you make libraries. I try really hard
by jacquesm 4y ago
5 and 6 are super hard decisions. You never really know what your code will be used for in the future, especially not if you make libraries.
I try really hard to do this and over the years I've found myself more than once caught out by something that I wished I had foreseen but did not and, conversely, I have spent a lot of time preparing code for changes which seemed to be likely to happen but that never did.
- hbrn 4y agoThis is a really good point. Engineers are constantly trying to predict the future, but ability to do so often does not depend on engineering skills at all. Often it is completely out of your control. Instead of trying to make code "extendable" I found that it is much better to make code "disposable". Do not hope you'll make the right prediction. Expect to be wrong and be able to recover fast.
- tabtab 4y agoKnowledge of the domain and general experience with similar domains helps. My horse sense about what's likely to change has improved with time. As far as #6, you don't want to outright limit change because the future surprises, but use a YAGNI-ish view of unlikely changes to keep the system simpler. In other words, you don't make it hard to change, you just don't spend complexity on things unlikely to change. You only spend abstraction-related complexity on things likely to change.