2 comments

[ 5.6 ms ] story [ 13.0 ms ] thread
This is what should exist instead of inheritance.

Change my mind.

absolutely. By this point I am convinced that design of most programming languages is driven by what is implemented easily in the compiler, rather than programming ergonomics.

This is the main takeaway by the "billion dollar mistake". It is not the fact that nullability can be a problem. It is the easiness of creating a "nullability feature" that was too tempting not to include it.

Same with inheritance. All you need for inheritance is a class pointer from your subclass to your superclass. But on top of method delegation, you also got layout inheritance.

Layout polymorphism is rarely something you want.