Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Until getting the ? operator in Rust, I always thought I really liked exceptions. After all, what was the alternative? `if err != nil { return nil, err }` everywhere just to propagate errors up and probably ultimately have the process panic when there's an error? "How obnoxious", I thought; the vast majority of the time I'd rather crash and be restarted than attempt to recover and risk severely corrupting state.

Turns out I strongly prefer explicit errors over exceptions, I just also strongly prefer error handling not consuming 75% of the lines on my screen.

And in the cases where I really do prefer a panic, there's always `.unwrap()`



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: