Go and Rust — Objects without Class

Depending on the language and the programmer, asking somebody to define inheritance could result in one of several different explanations and behaviors. Neil Brown tackles the nebula that is inheritance, and how Go and Rust attempt to clear up the confusion by providing clear alternatives with specific benefits. An important note is how the removal of classes from Go and Rust is not a primary motive, but a side effect of specific design decisions.

The article also mentions one of the reasons I appreciate Go’s approach so much: instead of faffing about in runtime hoping distinctions between polymorphic instances are caught, Go gets rid of the notion of ‘type hierarchy’ altogether, and lets the compiler discern what instances are capable of doing what, and where. Programs should not read as a “debate with the compiler”, as Dick Gabriel said.