-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Description
What is or isn't OO is a complex topic, one that requires a lot of nuance to explain. There are many different conceptions of what OO means. The FAQ doesn't do a good job of making the Rust OO situation clear.
There are two questions on this subject:
- https://www.rust-lang.org/en-US/faq.html#is-rust-object-oriented
- https://www.rust-lang.org/en-US/faq.html#how-do-i-map-object-oriented-concepts-to-rust
They are both rather bare and kinda don't answer the questions, at least not in a satisfying way.
I'd expect them to acknowledge that defining OO is difficult, means different things to different people, various OO concepts can be expressed in various ways with various degrees of fidelity, that if OO means e.g. 'structural inheritance' then basically Rust is not OO, but if that's what you really want then consider this pattern. It might even start off firmly by saying something like 'No, Rust is not an object-oriented language in the way that Java or Smalltalk are; rather, it is a multi-paradigm language that solves some problems using techniques from object-oriented languages, while the solutions to other problems draw influence from other paradigms. Many object-oriented patterns can be represented - some idiomatically, some not - in Rust, but in different forms than one might expect' etc.