Live data from Hacker News

Go 1.22

go.dev

161–164 of 164 posts

Re: Go 1.22

#161
post #45
post #40

Earlier quoted context omitted.

I think you could write something using the experimental Rangefunc feature that does that.

You can, which makes me wonder why they added the range-over-int functionality when it could have been a function in the proposed iter package: for x := range iter.N(10) { ... }

Better yet, you can name it something like `iter.ZeroTo(10)` and it immediately clears up questions about whether it begins from 0 or 1.

Re: Go 1.22

#162
post #67

Earlier quoted context omitted.

Yes, but TS users can stay on the "type-newbie" path, which is still a huge improvement over vanilla JS and doesn't take much effort. What I've had issues with is devs who came from the vanilla JS world and love it, so they go out of their way to avoid utilizing more complex types when they would add no-cost safety (aside from the initial minutes or hour spent learning the feature).

And that's dangerous; give people a lot of advanced options and they will inadvertedly use them, and nobody will dare to touch it, and it'll cause a lot of headaches, etc etc etc. Scala made this mistake as well. Go is the antithesis to TS and Scala, and I hope they keep it up. I also hope but doubt that they will do something few other languages dare: remove features.

Go certainly has a very different philosophy, but I don't think it's necessarily superior. Typescript is not as academic as Scala, but it gives power to developers who are willing to put in the effort to learn. With that power comes greater efficiencies and type safety.

Re: Go 1.22

#163
post #71

Earlier quoted context omitted.

I got to spend a couple years writing Dart (not Flutter) and found it to be the best of both worlds. Such an underappreciated language.

Interesting, Dart for backend? Do you build APIs? How is the ecosystem? I heard good thing of Swift as well, but I have concerns that it's to niche for backend stuff.

I was working on Google Assistant at the time; the dialogue manager was written in Dart. I was mostly writing libraries and platform code...so APIs in a sense.

The ecosystem isn't huge outside of Flutter, of course.

Re: Go 1.22

#164

I've been mostly writing Typescript the past 3 years - and recently started writing code in Go. Initially I was a little apprehensive, lack of array functions, slightly less flexible type-system, etc. But after spending some time writing Go I now had to re-initialise a typescript project for a small-ish team (4-5 devs). The amount of time spent on things such as linting, selecting the correct library for server routi…

Yeah someone I know has been banging on about go, too. I have a personal project I want to do so maybe I'll pick go for it.

The main pro and con to the JS ecosystem is the fact that it's so flexible; you can mostly do things how you want and there are so many libraries in each space all competing. But because you can do anything how you like it becomes hard to decide which library you want to use (or a diff one every project) and every dev has a different way of accomplishing the same thing.

I used to write internal libraries and frameworks a lot in my career and one of my mantras was to use TS to try to lock devs into doing things a certain way but there only so far you can go.

My main worry with Go is like, is everything built in? Are there multiple say, Web server libs like with nodejs or only a single option? How are deficiencies addressed if there are fewer options and fewer ways og doing things?

Post reply on HN