3 ms·
In OO, the interface. It seemed like the most useless construct. Zero implementation. Why make something with no implementation? Later I realised that the bene
by richardw 4y ago
In OO, the interface. It seemed like the most useless construct. Zero implementation. Why make something with no implementation?
Later I realised that the benefit isn’t the code, it’s the freedom you gain later in choosing the implementation. You can create an interface and add a simple implementation, then later swap it out for something more robust. All you’re agreeing to now is the contract of what needs to be done, without any restrictions on how.