News for hackers. Stuff that matters.
Re:How to start a Go project in 2023 by gadflyinyoureye on Tuesday May 23, 2023 @02:38PM (#36048840)
It’s verbose. Errors everywhere.

There are a lot of foot guns. nil slice? Fine. nil map? Segfault. Loop variables with closures. The list goes on.

Generics seemingly split the community. May be some libraries won’t get used because they picked the wrong side.

It’s surprisingly weak at modeling data. Union types would really help out.

The community is so anti-design that it’s hard to play with them. Most want to make a big ball of mud and call it agile. When you point out simple patterns, they call you an Architect Astronaut. Checkout r/golang. Also look out for people telling you how dumb you are for wanting generics.

In many cases it’s a step backwards but it has the positives you posted. That is often a reason to grin and bear it. Eventually Stockholm Syndrome kicks in.

Re:How to start a Go project in 2023 by typical182 on Tuesday May 23, 2023 @03:39PM (#36049764)
> Generics seemingly split the community. May be some libraries won’t get used because they picked the wrong side.

I haven't really observed that at all.

One thing that is going on is there hasn't been a massive disruption while everyone stops to rewrite the world in generics, and generics are not suddenly everywhere, which is what some people had predicted would happen. I think part of the reason is that in some cases another solution (closures or interfaces or whatever) can be a better fit, and the evolutionary approach to generics that Go took means you can use generics in conjunction with non-generic libraries or other pre-existing approaches without suffering from an ecosystem split.

Re:How to start a Go project in 2023 by 0zemp2c on Tuesday May 23, 2023 @02:43PM (#36048904)
> Loop variables with closures

indeed a brutal footgun but will be fixed soon

Re:How to start a Go project in 2023 by sapiogram on Tuesday May 23, 2023 @04:14PM (#36050232)
Have they actually agreed on how to fix this now?
Re:How to start a Go project in 2023 by typical182 on Tuesday May 23, 2023 @09:23PM (#36052896)
Effectively yes.

There’s a concrete proposal from the core Go team (along with an available experimental implementation) that seems to be on track for acceptance:

https://github.com/golang/go/issues/60078

It’s going through the official proposal process, which is how language changes happen in Go.