3 ms·
How do you ensure that a language with explicit interfaces implements what the expected behavior is?
by thwarted 4y ago
How do you ensure that a language with explicit interfaces implements what the expected behavior is?
- pjmlp 4y agoIt is a kind of honour system, the developer has explicitly stated, yes I want to comply to interface XYZ, instead of doing it by accident and due to copy-paste error passing the wrong one, ensuring a couple of debugging hours tracking down where the error lies in code that compiles without any issues. Typical debugging problem in dynamic languages.
- bheadmaster 4y ago> the developer has explicitly stated, yes I want to comply to interface XYZ, instead of doing it by accident To be honest, it's pretty hard to implement an interface by accident. You'd have to specifically implement methods with specific names and type signatures. If method names + type signatures don't intuitively specify how should implementation behave, then it's either a bad interface or a trivial one.