I came across this article the other day, titled “Why Rust cannot replace C++”.
I feel that the author completely fails to understand the opposing argument. The article claims that with “new” C++ features like smart pointers, you can write safe code in C++, therefore Rust is unnecessary.
But I don’t want a language where I can write safe code, I want a language where I must write safe code.
Sure, it’s much easier to pass pointers (*, &, or shared_ptr) around, but now I have the “cognitive overhead” of ensuring that it’s only accessed from one thread at a time. Or not used after it’s been freed in the former cases.
When I’m working with the borrow checker that is something that I don’t have to think about. It’s less “cognitive overhead”.
There’s this common statement that “the cognitive overhead of working with the borrow checker just isn’t worth the security benefits when you can write safe code in other languages”.
But the comparison is always to the “cognitive overhead” of writing something in some other language. When the comparison should be to writing something correctly in some other language.
@mgeisler that’s a bit my point. A style guide is useful if you have the time and ability to train people on it, but if checking compliance is something a human has to do then you’ve still got cognitive overhead and humans, of course, get things wrong sometimes.
@fasterthanlime I thought this was the main difference between margins and padding (because aside from this you can add/remove ancesters and change where you put the margin/padding to use one or the other).
Have you had experience, successful or otherwise, promoting #rust within your company? Especially to other teams and departments once you’ve started using it in your own team?
I would love to hear what you think went well and what you would have done differently in hindsight.
Comments in replies and boost for visibility please! 🦀
@molly0xfff@vampiress looks like I need a new RSS reader. There are some suggestions in this thread that I’ll try, but if anyone else has recommendations, I’d be happy to hear them.
@timClicks the medium sized retailer and publisher I worked for in London had 30 day payment terms when I moved from employee to freelance, so the extra 15 days doesn’t seem too bad for such a monster… 🤷♀️
@Vyothric@foone I loved this game when I was younger, I think it was pretty new when I played it (but you could never be sure with shareware games in Australia when you didn’t use the internet).
I like writing #rust because I feel like I don’t need to be a wizard to write correct, readable code with good performance. I never felt this way about #cpp (and I’ve done fewer hours of rust than C++).
I heard Steve Klabnik say pretty much the same thing on a podcast* as “I like #rust because I can program it when I’m drunk (or tired, stressed, etc.).”