7 ms·
People really like to hate on Rust for some reason. This wasn’t a Rust problem, no language would have saved them from this kind of issue. In fact, the compiler
by yoyohello13 1y ago
People really like to hate on Rust for some reason. This wasn’t a Rust problem, no language would have saved them from this kind of issue. In fact, the compiler would have warned that this was a possible issue.
I get it, don’t pick languages just because they are trendy, but if any company’s use case is a perfect fit for Rust it’s cloudflare.
- SchemaLoad 1y agoYeah even if you handled this situation without unwrap() if you just went down an error path that didn't panic, the service would likely still be inoperable if every single request went down the error path.
- HL33tibCe7 1y agoOkay, but if you returned a wrapped error it’d at least be easier to debug.
- VMG 11mo agonot necessarily, by default `Result` does not even carry a stack trace
- samdoesnothing 1y agoThe reason why people are criticizing is because Rust evangelicals say stuff like "if it compiles it works" or talk about how Rust's type system is so much better than other languages that it catches logic errors like this. You won't see Go or Java developers making such strong claims about their preferred languages.
- Patryk27 1y ago> [...] it catches logic errors like this but Rust's type system did catch this error - and then author decided it's fine to panic if this error happens > You won't see Go or Java developers making such strong claims about their preferred languages. yess no Java developer ever said that OOP will solve world hunger
- samdoesnothing 1y ago> but Rust's type system did catch this error - and then author decided it's fine to panic if this error happens The issue is that it wasn't fine to panic, thus Rust did not catch this error.
- yoyohello13 11mo agoCome on now. You can't blame the compiler when the programmer explicitly told the compiler to not worry about it. There is nothing in existence that can protect against something like that.
- samdoesnothing 11mo agoI'm not blaming the compiler, of course programmers can explicitly write incorrect code in any language. It's not Rust's fault.