Re:Cloudflare outage on November 18, 2025 post mortem
by Rohansi on Tuesday November 18, 2025 @08:36PM
(#45974837)
The difference is functions which return Result have explicitly chosen to return a Result because they can fail. Sure, it might not fail in the current implementation and/or configuration, but that could change later and you might not know until it causes problems. The type system is there to help you - why ignore it?
[ Parent
| on HN ]
Re:Cloudflare outage on November 18, 2025 post mortem
by Dylan16807 on Tuesday November 18, 2025 @08:40PM
(#45974867)
Because it would be a huge hassle to go into that library and write an alternate version that doesn't return a Result. So you're stuck with the type system being wrong in some way. You can add error-handling code upfront but it will be dead code at that point in time, which is also not good.
Re:Cloudflare outage on November 18, 2025 post mortem
by jamincan on Wednesday November 19, 2025 @12:41PM
(#45982379)
As a hypothetical example, when making a regex, I call `Regex::new(r"/d+")` which returns a result because my regex could be malformed and it could miscompile. It is entirely reasonable to unwrap this, though, as I will find out pretty quickly that it works or fails once I test the program.