I’m conflicted on this one
On the one hand, there’s the YAGNI principle that states that you shouldn’t write anything that you don’t need right now
On the other hand, preventing problems is generally cheaper than solving them later on
For example, the moment you add a second if-else branch, you don’t need to refactor it and design it the OOP way (and write more code). But if you foresee that keeping on with the procedural approach will land you and your team in a maintenance hell one day, you are arguably being shortsighted. It’s not what a professional software developer should be, I believe
So there are cases when foreseeing is bad and there are cases when foreseeing is good
If so, how do I tell the two apart?