3 ms·
Go, Python, and C++ are all notably languages that encourage a traditional imperative model of programming with things like for-loops and lots of mutation. I've
by nicoburns 7y ago
Go, Python, and C++ are all notably languages that encourage a traditional imperative model of programming with things like for-loops and lots of mutation. I've noticed that developers with a background in these kind of languages struggle with Rust, which works much better with a functional approach.
Coming from JavaScript, my Rust code is often almost identical to my JS code. With perhaps a few extra `.clone()`s, a bit of extra error handling code (which is of course the benefit!), and type annotations.
- throwaway894345 7y agoI’m perfectly comfortable with a “functional” as it pertains to Rust. In particular, Python (and to a lesser and more recent extent, C++) have had a lot of functional features (iterators, first-class-function, etc) for quite a while. The lack of GC actually makes it harder to use closures in Rust than Python or even Go.