Tried running a couple of examples in the tour, but ran into a few errors.
Go 1.27 Interactive Tour
31–40 of 219 posts
Re: Go 1.27 Interactive Tour
#32Tried running a couple of examples in the tour, but ran into a few errors.
Re: Go 1.27 Interactive Tour
#33Earlier quoted context omitted.
No. I kind of want to leave it there. But that will probably be looked on disfavorably. I've seen at least a dozen attempts. It's not like it's hard to write it out. There's maybe a couple of variants but they're all just a handful of lines. The problem is, once you have an Option in hand, you end up trading: val, err := whatever(...) if err != nil { // handle error } // use val for val := whatever(...) if err, isErr…
I think my opinion will be even more maligned: I like Java-style checked exceptions. It forces awareness of the error and a clean way to propagate it.
Thanks so much for that! Now I have no choice but to be reactive when something fails…
Re: Go 1.27 Interactive Tour
#34Earlier quoted context omitted.
Unfortunately nothing changed. They wanted generics all along. The Go ecosystem was a delicate, special thing. It was a wholesale rejection of the malignant consultancy takeover of programming that had festered and spread for the previous 15 years. Introducing generics was a grievous error, and they just keep making it worse. It used to be you could look at any Go code from any author and pretty much instantly unders…
I have written Go for the past decade and completely, fundamentally disagree with this take. Go has always had a tendency towards limited exressivity, which created a strong dependence on interface{}, type assertions, and runtime bug’s that should have been compiler errors. When I read these grumbling takes about how Go use to be so simple etc I imagine devs who would revel in all the features they were unable to imp…
Re: Go 1.27 Interactive Tour
#35generics were a slippery slope. give it a decade and Go will be indistinguishable from c++
Re: Go 1.27 Interactive Tour
#36Those Generics syntax in Golang seems so hard to read.
It is verbose but inference helps a lot to keep it “tidy”. I always find myself increasing my focus a notch when I start dealing with generics. It’s one of the things I use only if I really “need”.
Re: Go 1.27 Interactive Tour
#37Am I the only one who’s absolutely shocked that Go finally is embracing generics? Does anyone have a bit of an inside view into what changed in the perspectives of the language maintainers? I’m not buying the “it took us 20 years to understand how to do it correctly” argument, as this is something you explicitly take into consideration when designing the language or not. And it was specifically not a part of language…
and they're still worse than the 1970s state of the art lol
Re: Go 1.27 Interactive Tour
#38Re: Go 1.27 Interactive Tour
#39Re: Go 1.27 Interactive Tour
#40Automatically draining http response bodies is a risky silent behaviour change. I think it will be an improvement for most applications, but it's very subtle if you were relying on the old behaviour