Rust Is Beyond Object-Oriented, Part 3: Inheritance

In this next1 post of my series explaining how Rust is better off without Object-Oriented Programming, I discuss the last and (in my opinion) the weirdest of OOP’s 3 traditional pillars. It’s not encapsulation, a great idea which exists in some form in every modern programming language, just OOP does it oddly. It’s not polymorphism, also a great idea that OOP puts too many restrictions on, and that Rust borrows a better design for from Haskell (with syntax from C++).

The Coded Message

@rust_discussions Just noticed this in the article that I think is not accurate:

"There is no inheritance in Rust. There are no fields in traits. There is simply no way of saying that in order to implement a trait, your type must have certain fields."

Traits can have implemented methods taking self, and if those methods refer to fields in self type-checking won't allow a struct to implement that trait without having those fields, no?