DEV Community

Discussion on: πŸ¦€ Rust Reviewed: Is the hype justified? πŸ¦€

Collapse
 
rustyf profile image
Russ Freeman πŸ‡ͺπŸ‡Ί #FBPE

Great article!

There is a trend towards writing more immutable, functionally pure code and I’ve seen the benefits of this. Does this resonate in any way with you or in how rust is designed?

Collapse
 
stanmart profile image
stanmart

Yes. Variables and references are immutable by default, and have to be explicitly annotated to be mutable. Also, many features will remind you of functional languages from the ML-family (especially Haskell): algebraic data types, monadic exception handling, typeclasses, associated types.

Collapse
 
somedood profile image
Basti Ortiz • Edited

Yes, it does! But not in the pedantic sense, of course. I still see the value in traditional object-oriented code. Rust is just there to nudge me in the right direction when I attempt to get too clever for my own good.

Overall, what resonates with me the most is the fact that Rust effectively synergizes functional-style code and object-oriented code. It forms a "yin and yang" of sorts between immutability and mutability. This is unlike many languages where the paradigms are set in stone. For instance, Java is notoriously object-oriented while Haskell is confusingly functional. Rust just seems to strike a goodβ€”if not perfectβ€”balance, you know?