this post was submitted on 15 Jun 2023
8 points (100.0% liked)
Rust Programming
8159 readers
1 users here now
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
OO programming is such an overloaded concept that the answer here is "kinda".
Rust does make some patterns like the "sea of pointers" of OO languages a bit difficult (mostly due to borrow checking). It also doesn't feature data inheritance.
However, rust promotes a style of programming where encapsulation is key (notably to provide safe APIs around unsafe parts), and while the encapsulation unit is the module arguably structs with invariants are still "objects", in that in code that emphasizes maintainability you don't interact with their data directly but through their methods, this bundling data with behaviour. It also features static polymorphism through generics and trait, and dynamic polymorphism through either enums or through trait objects.
My personal take away is that rust has OOP, the good parts.