I've seen Go folks say, in effect, "Rust's experience with try doesn't apply to Go because Rust users don't have as strong opinions on readability as we do." Oh, you sweet summer child...
-
-
Replying to @pcwalton
For whatever reason it seems a fairly pervasive opinion that an additional 3 lines of error handling boilerplate per function call is more readable somehow: https://old.reddit.com/r/golang/comments/c9qj8j/one_of_rusts_designers_on_going_from_explicit/et3bzu7/ …
2 replies 0 retweets 23 likes -
Ivo Georgiev Retweeted ✕✕✕✕✕
Ivo Georgiev added,
1 reply 1 retweet 2 likes -
try makes code less readable because it’s (a) nestable and (b) triggers a function exit. other proposals that also reduce SLoC but don’t have these properties (i.e. are keywords) are much better
3 replies 1 retweet 9 likes -
No, that has not been our experience at all. Try is more than clear and readable enough. I confess I have trouble understanding why the experience of Rust is so casually dismissed in these conversations.
3 replies 0 retweets 11 likes -
Replying to @pcwalton @peterbourgon and
It's like... we literally did an experiment to answer the question "does try reduce readability"? The results were clear.
1 reply 0 retweets 13 likes -
Replying to @pcwalton @peterbourgon and
Mine is a loaded opinion (I agree with Peter), but I think drawing comparisons between Go and Rust's readability may not be effective. People who've used Go substantially are likely to think its readability is one of its best features, and it will be defended as such.
3 replies 0 retweets 4 likes -
Tony “Abolish ICE” Arcieri 🦀 Retweeted Tony “Abolish ICE” Arcieri 🦀
I think you're right, i.e. this is how Gophers feel about the language, but as someone who spends a lot of time reading Go code (and in particular Go cryptography code) I'm always left wanting something better, particularly around error handlinghttps://twitter.com/bascule/status/1148274481372131332 …
Tony “Abolish ICE” Arcieri 🦀 added,
Tony “Abolish ICE” Arcieri 🦀 @basculeReplying to @bascule @reaperhulk @veorqAs it were, just came across this: how Go handles PSS. Love the comment and the solution (although I find the implementation fairly unreadable) https://github.com/golang/go/blob/master/src/crypto/x509/x509.go#L443 … pic.twitter.com/7hiU8WSzcs2 replies 0 retweets 4 likes -
Here are a couple of other examples from the same file (from Go stdlib). Personally I find the error handling logic in these cases convoluted and a bit hard to follow. https://github.com/golang/go/blob/master/src/crypto/x509/x509.go …pic.twitter.com/GKDgnzoRwe
3 replies 0 retweets 2 likes
Ouch, yeah, mixing err != nil and err == nil like that is rough. Give me try any day.
-
-
try is not applicable to that example
1 reply 0 retweets 0 likes -
Replying to @peterbourgon @pcwalton and
Here's a quick-and-dirty Rust translation of that code which uses try:pic.twitter.com/AFHAY4iDn5
1 reply 0 retweets 1 like - 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.