Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
devios157706yI was super stoked about it until I found out it doesn’t have inheritance. I’m not a fan of boilerplate.
-
devios157706y@Hubot-0x58 I‘m not 100% sure, but at any rate I found it’s a very different mindset programming in Rust compared to OOP. It’s closer to C in that you have data structures that are completely public and functions that act on those structures.
I like the idea of traits, but I found concepts that were simple to me in OOP are much harder (or at least very unfamiliar) to wrap your head around in Rust. -
devios157706yThe example I ran into was that I wanted to have an abstract class whose implementations would override a virtual function and implement different logic in each subclass but be treated as instances of the same abstract type at a higher level. I couldn’t figure out how to implement even as simple a concept as that in Rust (without yucky boilerplate) and I decided I didn’t need to deal with the added complexity of learning a whole new methodology when I have enough to solve already.
I may explore Rust again in the future when my design is more stable and stuff actually works, because I love the guarantee of memory and thread safety and the concept of ownership, but for now the lack of OOP is just too foreign to me.
Related Rants
Holy Shit, Rust Is Nice!
Just Used it first time!
rant
it's beautiful
rust