3 ms·
It seems like the debate boils down to "should subclasses be able to override behaviour in ways the base class doesn't anticipate?". Pro: sometimes it lets you
by victor___ 8y ago
It seems like the debate boils down to "should subclasses be able to override behaviour in ways the base class doesn't anticipate?".
Pro: sometimes it lets you extend classes in useful ways that the original author didn't anticipate.
Con: it makes it difficult or impossible to reason about invariants in the base class.
Seems like it's a trade-off between hack-ability and robustness.
- andybak 8y ago> Seems like it's a trade-off between hack-ability and robustness. Precisely. This is where Python's "We're all adults, here" philosophy comes into play: just trust me with the footgun. I'll take responsibility for the risk but dammit, if I'm not going to be pissed when I can't do something I know I need to do. Maybe it's the distinction between "languages for large teams of mediocre programmers" vs "languages for hackers or small experienced teams"