9
Thinking Functionally in Rust
Let’s take a moment to appreciate another wonderful aspect of Rust: its support for functional programming ideas.
Functional programming is a style where we treat computation as we do evaluating mathematical functions, often preferring immutable data and steering clear of side effects.
Even though Rust isn’t solely a functional language (it’s actually multi-paradigm), it adopts many helpful concepts from this style because they bring so many benefits.
Using these functional techniques often makes your code cleaner, more declarative, and easier to understand and debug.
And by reducing side effects, these patterns can make it simpler to develop correct and efficient concurrent code, which is one of Rust’s key strengths. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access