3 ms·
> Programmer’s time is valuable, and, if you pick Rust, expect to spend some of it on learning the ropes. Of all the arguments, time-to-productivity may be the
by aazaa 6y ago
> Programmer’s time is valuable, and, if you pick Rust, expect to spend some of it on learning the ropes.
Of all the arguments, time-to-productivity may be the most compelling. Rust will keep most new programmers from being productive far longer than any other language. I'd say 3x minimum.
What's a little surprising, though, is how many of the difficulties beginners have stem from just one concept: ownership.
Counterintuitively, ownership is quite simple. But what's mind-bending about it is that it doesn't exist in any other language a beginner is likely to have used. Yet ownership pervades Rust, sometimes in very hard to detect ways. And perversely, it's possible to write a lot of Rust without ever "seeing" ownership thanks to the complier.
Eventually, though, the beginner comes face-to-face with ownership without recognizing the trap s/he's fallen into. Ownership isn't something you can "discover" by messing around in the same way that most language features can be teased apart. The term "fighting with the borrow checker" is actually a symptom not of a struggle with a feature but a struggle with a basic, non-negotiable concept that hasn't been learned.
I can recommend this video for getting over the hump:
https://www.youtube.com/watch?list=PLLqEtX6ql2EyPAZ1M2_C0GgVd4A-_L4_5&v=1QoT9fmPYr8 https://www.youtube.com/watch?list=PLLqEtX6ql2EyPAZ1M2_C0GgV...
In my experience, Rust productivity shoots up by a lot given a basic understanding of ownership.
- dlubarov 6y agoBesides the learning difficulty, I'd there are some real ergonomic issues related to ownership, such as the difficulty of cloning into a closure [1], or nested &mut receiver calls being rejected despite being sound [2]. [1] https://github.com/rust-lang/rfcs/issues/2407 https://github.com/rust-lang/rfcs/issues/2407 [2] https://github.com/rust-lang/rust/issues/6268 https://github.com/rust-lang/rust/issues/6268
- lostcolony 6y ago"But what's mind-bending about it is that it doesn't exist in any other language a beginner is likely to have used." This is true about killer features in any language that is above the 'average' on the power spectrum ( http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html ). In fact, even beyond beginners, I see resumes for people all the time with 20+ years who have only used Java/Python/C/C++. If you are evaluating languages for power or expressiveness, not just tooling/libraries/domain integrations, you're going to have longer ramp up time on average, regardless of the seniority of the developer, because you're by definition looking for features that aren't average (and therefore not mainstream).
- higerordermap 6y agoAnyone who doesn't like my favourite language is a blub programmer.
- __d 6y agoDo you know C++ well? Could you compare time to productivity for C++ and Rust?
- non-entity 6y agoI'd be interested in this as well. C++ seems like a complex beast and full of legacy code / learning materials. I feel I'd could likely be writing decent Rust code sooner than I could C++.
- pjmlp 6y agoAnd 40 years of history, wait until Rust survives for 40 years to see how it looks like.
- dagmx 6y agoI think it depends where you spend time in each language and what projects you do. I use both regularly, and with Rust my time to productivity is faster because I'm not dealing with a build system first and with splitting code between headers and implementations. I find rust is also better for letting me keep less of the program mentally in mind since I can localize my thinking about data a lot more. Where rust is worse for productivity is the learning curve is high for many (though personally I found it much less so than C++ given how large the language has gotten). The other issue is most libraries I deal with are built in C++ so I have to either bridge them or drop back to C++