The error handling in still leaves a lot to be desired. `if err != nil` repeated ad infinitum in a codebase is bad... but not whinging about unhandled errors is worse imo.
Conversation
As is always the way with not-quite-there languages (Ruby, JS, etc.) the answer is "just install <a random package from the community>" stackoverflow.com/a/43901848
1
1
Rust's is okay (I much prefer it to Go's way), but it's not perfect. Making new error types can be annoying and a bit boilerplatey for example. I definitely think they made the right choice going with a tagged union of multiple returns like Go did.
What in particular do you struggle with syntax wise?
let x = foo()?;
Is pretty much the same as:
x, err := foo()
if err != nil {
return err
}
1
A simple thing: trying to read each line in a file, split them by a space, and return a two-element vector for each line. I’ll send you some code when I’m back at my machine.
1
1
Show replies

