News for hackers. Stuff that matters.
Re:Rust vs Go: A Hands-On Comparison by Thaxll on Wednesday September 27, 2023 @02:00PM (#37678563)
But you're not comparing the same thing, Go handle errors and act on it, Rust code just "forward" the error.

Control flow wise, Go is much easier to understand than chains of ? and await.

Re:Rust vs Go: A Hands-On Comparison by jamincan on Wednesday September 27, 2023 @02:46PM (#37679346)
Rust doesn't just forward the error, it forwards and converts the error. ? is effectively semantic sugar for:

`match result { Ok(v) => v, Err(e) => return e.into() }`

This means that the code related to error handling is all in one place, and your business logic can just focus on the happy path.