4 ms·
It's not that it's hard to type. It's that in Go, if you make a mistake with your error checking, your program has a bug. In better languages like Rust and Hask
by josephcsible 3y ago
It's not that it's hard to type. It's that in Go, if you make a mistake with your error checking, your program has a bug. In better languages like Rust and Haskell, if you make the same kind of mistake with error checking, your program doesn't compile.
And Go isn't even close to 1000x better than C. It makes almost all of the same mistakes that C did (especially the billion dollar mistake), despite being new enough that it should have learned from them.
- danenania 3y agoI like both Haskell and Rust (in theory; haven't written anything nontrivial in either). But they both seem to encourage you to spend a lot of time and energy on the meta aspects of programming. You can build safe, beautiful systems, but you can also happily spend all day (all week? all month?) playing various forms of code golf without actually producing anything. Go, like C, is a very get-it-done language. It doesn't let you have any fun at all with abstractions, so you end up just doing your work instead. In spite of its warts, I think Go is remarkable and unique for this quality.
- HippoBaro 3y agoThere's absolutely nothing in Rust that mandate error handling. You can always ignore them, just like in any other language.
- josephcsible 3y agoRust's type system mandates it. If you disagree, then post a Rust program that uses the result of a call to std::fs::read_to_string without specifying how to handle an error.
- rollcat 3y agoIt's about how hard it is to make a mistake in well-intentioned code. The number of times my fingers typed "if err != nil" when what I did actually mean was "if err == nil" is too damn high, and the consequences often dire. I usually prefer Go to Rust (and even defend Go's error handling most of the time), but that's the one aspect that Rust handles 1000x better: the common case must be easier, so that you don't get as easily tripped up by the uncommon.