3 ms·
I'm not sure LSP can be formally enforced unless you encode the contracts of each methods and prove they are held. This is probably doable in many cases, but th
by nine_k 8y ago
I'm not sure LSP can be formally enforced unless you encode the contracts of each methods and prove they are held. This is probably doable in many cases, but the current tools seem pretty heavyweight, as is the mental burden.
Regarding these years, I very much regret that subclassing won over interfaces / traits / typeclasses without inheritance.
- zwieback 8y agoTrue but in statically typed languages we have a lot of options now. It's interesting to see how c# and C++ have developed and what approaches new languages are taking. My own practices have definitely changed over the last 25 years, where I initially used class hierarchies to model my problems I now think in terms of interfaces. Also, with everything being connected I just don't worry about building large monolithic systems composed of class libraries any more.