Hacker News new | ask | show | jobs
by vram22 2885 days ago
>You can also write it Go style if you prefer; we started off with exactly that, then moved to a macro, then turned that macro into ?.

Interesting. Does the Rust book (you wrote), explain the difference between the Go style and the current Rust style, and explain how to use the Rust style (well)?

Asking because I've found this Some / None stuff (also there in other languages like F#) a little tricky to understand (although I have not spent a lot of time on it yet).

1 comments

We talk about it a little, but the best resource on this topic by far is https://blog.burntsushi.net/rust-error-handling/ which works the whole way from first principles. It was in the first edition of the book but due to space requirements didn’t really fit in the second edition.
Thanks, will check that blog out.
No problem! In general, burntsushi’s work is some of the best in Rust. He’s also very fluent in Go.
Good to know, will check out his stuff in both languages, thanks.