Re:Go Replaces Interface{} with 'Any'
by tptacek on Tuesday December 14, 2021 @06:12PM
(#29559457)
A lot of people are going to write very un-idiomatic Go code with "Result" types built on simple generics that, 5 years from now, we'll all be kind of smirking at. Rust's Option and Result make sense because the language supports it (most importantly with match statements). They don't make sense here.
[ Parent
| on HN ]
Fun observation of mine: most articles/tutorials I've read about "idiomatic go code" are presenting ideas that you never see in any production code.
Seems to me that the ones who write about "idiomatic go code" aren't the ones who are shipping softwares/libraries.
This seems pretty glib. There's pretty obviously a phenomenon where people try (or used to try) to write code for other languages (less commonly Rust, more commonly Ruby) in Go, and that code is kind of notoriously uncooperative with the rest of the ecosystem and hard to maintain. You'll find it in Go web stack libraries, in particular, or with code for people who tried to fake generics with codegen.
Re:Go Replaces Interface{} with 'Any'
by preseinger on Wednesday December 15, 2021 @02:47AM
(#29563140)
Example?
The majority of Go I've been hired to improve has suffered immensely from not using accepted idioms. Most of my work has been focused on introducing those idioms systemically.