5 ms·
This is just anecdotal, but for me productivity in Rust is way higher than C++. Sum types and pattern matching, affine types, the choices made by the standard l
by Rusky 9y ago
This is just anecdotal, but for me productivity in Rust is way higher than C++. Sum types and pattern matching, affine types, the choices made by the standard library, and Cargo all contribute to that.
I suspect once you get your head wrapped around Rust's type system idioms things will get better. I am interested to see how this turns out for people in general, though.
- srssays 9y agoC++ is somewhat of a low bar, because of the state of the art in package management in C++ land is "download a header-only library". C++ does have sum types in the form of boost::variant, but boost is an abomination. The danger to Rust is that for many projects it wins by default because the alternative languages are immature, rather than because its performance/security capabilities are actually worth the productivity trade-off compared to other languages. Once Swift matures a bit, it will take a lot of the lustre from Rust.
- Amezarak 9y agoI'd say it worked similarly for me. There was an initial hard slog around the borrow checker, but once it all clicked it's been very smooth sailing. The only thing I've had trouble with in the months since is when I went to write some macros, but that was more me not reading the docs closely enough. I'd say I am very productive in it now and I don't view any of Rust's features as being a productivity problem. If you're struggling with Rust, I'd say keep going until you get that "click."
- pjmlp 9y agoI cannot say the same due to lack of support for GUI toolkits, the way the borrow checker handles callbacks, or mixed debugging support. You can get sum types in C++17 and with boost::variant in early versions.
- Rusky 9y agoThat's fair, the ecosystem certainly isn't ready for every use case. What specifically do you mean by "the way the borrow checker handles callbacks"?
- pjmlp 9y agoIt is described in the Non-lexical lifetimes RFC under "Closure desugaring". https://github.com/nikomatsakis/nll-rfc/blob/master/0000-nonlexical-lifetimes.md https://github.com/nikomatsakis/nll-rfc/blob/master/0000-non... Basically if you have a struct to represent, lets say a Window, and inside of it try to reference instance variables on a closure that would handle a button click for example, self will be moved. There are a few workarounds, but all of them are less ergonomic than any mainstream GUI toolkit.