I’ve been seeing lots of hate for Rust on LinkedIn today, and I want to take a moment to talk about a few things that come to mind; some I think are obvious, others maybe less so.
First, I can tell that the conversation is being dominated by people who don’t use Rust.
I don’t think this is surprising, since everyone and their mom is always an expert on whatever is the latest thing people are talking about... but since this is something I do know about, it does feel really odd to see people saying things like “this could never happen in GoLang, because we have if statements” and “If using .unwrap is basically the same as dereferencing a nullptr, then why not just use C++?” (These are barely exaggerations).
I do understand the argument that a language should be intuiti…
I’ve been seeing lots of hate for Rust on LinkedIn today, and I want to take a moment to talk about a few things that come to mind; some I think are obvious, others maybe less so.
First, I can tell that the conversation is being dominated by people who don’t use Rust.
I don’t think this is surprising, since everyone and their mom is always an expert on whatever is the latest thing people are talking about... but since this is something I do know about, it does feel really odd to see people saying things like “this could never happen in GoLang, because we have if statements” and “If using .unwrap is basically the same as dereferencing a nullptr, then why not just use C++?” (These are barely exaggerations).
I do understand the argument that a language should be intuitive enough that you don’t need to read the docs to understand every little feature... but basically every source that might introduce you to unwrap immediately tells you that it’s a dangerous function, and that you probably actually want to use [insert laundry list of better alternatives].
Second, I am realizing how many programming and programming-adjacent people still think of programming languages as magic incantations.
People hear “Rust is safe” and they assume that means it’s a silver bullet that will never have any problems, regardless of what code you write. Cloudfare didn’t crash because Rust is a broken language that fails to deliver on its promises... it crashed because the offending code is roughly analogous to:
try {
try {
fallible_function();
} catch {
process.exit(1);
}
} catch {}
It’s unusual code, but it’s not inconceivable that someone might need to panic a program like this. People saying that this is because “unwrap” exists reminds me of how some people will litter their TypeScript code with as any and then declare that their program is crashing because “TypeScript failed.”
Third, people should use expect instead of unwrap in production code.
If your program must panic, at least embed the error message you’d want to receive if you had to fix it alone on a Friday. Neither the code nor the error messages indicated whether this was an intended behavior, and people are biased toward believing “this broke because it’s shit.” Had the message been something like “thread panicked because message size {size} exceeded {MAX_SIZE},” people would have a harder time grinding their axes.
Fourth, this is likely going to set back Rust adoption as a career-viable language.
There will be a lot of people whose only exposure to Rust are (a) overzealous Rustaceans who promise that Rust can win back your ex, and (b) their professional network meming about “that time Rust took down half the internet.” It’s already hard to evangelize for Rust in professional settings, and this is going to make it harder. I think it’s important that, if people want to use Rust in the workplace, then they should do so in a way that encourages other workplaces to adopt Rust; or, barring that, without discouraging its use. This was a freak accident, but (going back to my previous point) an error message explaining why it happened would’ve done wonders.
But I’d love to hear your thoughts.