3 ms·
Neither Haskell or Rust use inheritance for this though. They use Typeclasses or Traits respectively. Those have the nice property that they solve the specific
by zaphar 3y ago
Neither Haskell or Rust use inheritance for this though. They use Typeclasses or Traits respectively. Those have the nice property that they solve the specific problem of satisfying an interface for something without the accompanying problems of inheritance. Derive as an example doesn't use inheritance it uses code generation precisely because Rust wants to avoid inheritance.
The key insight of eevee's article is that OO has succeeded mostly because bundling state and behavior together is a really useful way to structure your code and is the thing that you should leverage the most out of object oriented languages.