|
|
|
|
|
by mrkeen
2387 days ago
|
|
What you lose is the ability to model objects based on the behaviours that they can perform. I want to be able to design objects that have toString() and I want to be able to design objects that don't have toString(). The same goes for clone(), hash(), getPtr(), getEndian(), equals(), toBytes(), toJson(), encrypt(), delete(), isNumeric(), toXml(), serializationVersion() or compare(). |
|
Now I'm wondering... are there languages which formalize "implement with a throw" into some kind of explicit refusal to implement a method? Obviously there are method-sharing approaches other than inheritance, but I've never heard of "you must implement this, or explicitly choose not to".