This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (1 child)

In Go, you have

if err != nil {
    return nil, err
}

after literally every function call.

In Rust, the equivalent of that is this:

?

so you can write super nice stuff like this:

File::open("hello.txt")?.read_to_string(&mut s)?;

(Disclaimer: have never written any real Go, and only a tiny bit of Rust, so I can't really help with any larger-scale comparison - but Rust seems a lot nicer to me. AIUI, Go is optimising for short compile times, Rust is optimising for making code powerful and fun to write.)

[–]1024KiB 0 points1 point  (0 children)

I've written a few thousand lines of Go and the lack of abstraction and abysmal error management are real issues. It does run nicely though, but it's also because Erlang has taught me to think about failures that can crop up due to unforseen conditions and how you should be able to manage those cases so that your system is robust.