@demensdeum, I’m not sure exactly what you mean by “OOP” here. My interpretation of object-oriented programming is that you can have types which bundle some data and also allow you to call methods on that type which let you do operations on the bundled data. Whether you use the
class keyword or
struct is just a syntax detail.
The big thing with OOP is the ability to have polymorphism, i.e. being able to use one type in the place of another type transparently as long as they specify some sort of interface. Traits and inheritance allow you to do this, it’s just implemented in different ways. Rust does things in a different way to C++ or Java (which is why it’s called “Rust”, not “C++++”), but I wouldn’t necessarily say one way of doing things is better or another is archaic.
I think you’ll find that differences like methods taking an explicit
self parameter instead of the implicit
this in Java or C++, or how you’ll define the contents of a type separate from the behaviour (the separate
impl MessagePresenter block) are only skin deep. You still often use similar patterns to “normal” OO languages, it’s just that you’ll use composition more and not have a deep type hierarchy.
I’d agree with @HadrienG. It always takes a bit of time to learn a new language and you often experience a bit of friction because you come in with a bunch of assumptions from your old language and find that those patterns aren’t idiomatic in the new one. Before learning Rust I did a lot of work with Python and C++, and it took me a while to get used to how Rust does things.
My advice would be to go along with it for a bit longer, try reimplementing some of your old applications in Rust to get a hang of the language, and don’t be afraid to ask questions like “is this idomatic?”, and try that for a couple weeks before deciding it’s not high level enough. For example, here’s a library for generating LaTeX documents I made. You’d be hard pressed to find something more high-level in Python or Ruby.