Here live my hottest, hottest takes.
The biggest splash, I made with Why Rust should only have provided expect…
not unwrap. Just reading my most recent edit at the top, where I
announce I don’t really believe this anymore, I have to sigh. Coming from Haskell
this take seemed so obvious. But Rust panics aren’t the same as Haskell partial functions.
Rust is an eager language, and panics are far more tractable. That and, unwrap() panics
actually give you a substantial amount of debug information if it’s from a Result::Err.
But most importantly, there’s just enough situations where it’s good to justify including
them in the standard library---including “the API author should’ve made a panicking version
of this function, but made you call unwrap() instead for some reason.”
For Warnings and Linter Errors: The Awkward Middle Children, the objections
were more philosophical. I argued that the warning/linting system of rustc was part of
the Rust programming language, a philosophical argument to begin with. I wanted Rust
to get credit for its warnings, as people used the fact that certain things were “only” a warning
to detract from Rust’s safety system. I also earnestly believe in the philosophical stance in that
post. People really wanted warnings to somehow not be part of the programming language / the compiler’s
contract, for some reason---I suppose a mathematically simple notion of what a programming language is,
which is a value of dubious virtue.
The Importance of Logging is quite lukewarm compared to these other takes, but it is in here because it is a take, or at least some unsolicited advice.