Jonathan
1 min readJan 24, 2021

--

Nice article, however, after 12 years of developing mostly in OOP languages and studying Rust since 1.0, I would not consider Rust object-oriented, since Rust misses one of the main pillars of the modern OOP: Inheritance (but it does have the other three: abstraction, composition and polymorphism).

Traits “inheritance” are just way to specify requirements, it is “To Impl A you must Impl B too" and not “When you Impl A you automatically Impl B" (which is the ideia behind Inheritance and subtyping).

If you try to render an UML of a Rust Struct inheritance, you will end up with a Struct lineraly linked to every Trait which has Impl to, instead of a Tree with Struct implementing a Trait which implements other Trait and so on.

Don’t get me wrong, you have made a good work in this article, I’m just trying to give another view about Rust abstraction, OOP definition does not have an widely accepted definition.

--

--

Jonathan
Jonathan

Written by Jonathan

Developer, Bytecode Engineer, Cyber security analyst, Workaholic, Critic, Writer.

No responses yet