Live data from Hacker News

Go 1.27

go.dev

241–250 of 277 posts

Re: Go 1.27

#241
post #212

Earlier quoted context omitted.

> Generally, something to be avoided by people striving for clearer communication Their communication seemed pretty clear to me. If anyone actually claims that they didn't understand what they meant but would have understood it by using the other form of the expression, I think that's a bold-faced lie.

I'm on the other side of this one, but take an up vote for a glorious closer. Well done good sir.

I'll admit I mostly stole the idea from https://xkcd.com/1576/

Re: Go 1.27

#242

Earlier quoted context omitted.

When I started learning Go I went all in including using the recommended editor (acme editor) which has no syntax highlighting, no autocomplete and a very different way of writing code. My production went down a lot but the quality of the code went up a lot. I think the lack of syntax highlighting was one reason for that. It makes you think more about the code you write and how it should compose, while a fully fledge…

I go through intervals of turning autocomplete on and off. I think autocomplete is useful for boilerplate (similarly LLMs are useful for boilerplate), but I prefer not to use either when writing code where correctness is particularly important. This is because it’s easier for me to internalize what something is doing by typing it out. It’s actually more effort for me to understand code by reading it rather than writi…

I think there's a lot of value to be gained from turning all modern day features off for once and just code "raw", no syntax highlighting, just typing out all the code. Doesn't even need to be your own code, manually transfering code over can also help a lot with your basic coding skills.

I think a lot of people lose this over time because it's easier to use templates, autocomplete and LLMs, work from a higher level. But it's nice to go back to basics. Consider also firing up Pico-8 and writing some really really bad code. It's got a very rudimentary editor, 40 columns of code, no syntax highlighting, and you're limited in how much total code you can write. It also helps with leetcode since a lot of leetcode uses game coding tricks like modulo operators, min/max/clamp, etc (that's as far as I got, don't judge).

Re: Go 1.27

#243

I really want to like Go, but I can't stand looking at Go code. The error handling is such a turn off.

This was my original take when I learned the language, but I later realised “errors as values” is one of the strengths of the language. I have run both Go and Python backends in production for years. There is an entire class of bugs present in Python services (missing error handling) that simply does not happen in my Go services. Python puts the burden of knowing what exception types a function call will raise on the…

I don't have a problem with the error handling per say, but it's the verbosity, yes.

Re: Go 1.27

#244

I really want to like Go, but I can't stand looking at Go code. The error handling is such a turn off.

Personally I feel go has many issues and is ugly as hell but the error handling is really the least of my worries.

It's the ugly as hell part that gets me.

Re: Go 1.27

#245

Brace for a wave of drive-by pull-requests swapping google/uuid [1] out for the now-standard uuid package [2]. Kubernetes project will be the first one [3] I guarantee it. [1] https://pkg.go.dev/github.com/google/uuid [2] https://go.dev/pkg/uuid [3] https://github.com/kubernetes/kubernetes/blob/2220c3853a2402... [4] https://github.com/google/uuid/issues/221

will 'go fix' take care of this?

I don't think it ever suggests anything specific to 3rd-party packages

Re: Go 1.27

#246
post #158

Struct literal changes while welcomed, have the issue of being a possible source of bugs, if there are overlapping fields, type Habitat struct { Burrow string } type Gopher struct { Name string Burrow string Habitat } It will not initialise what one expects, here it is a contrived example, however it may not be easy to spot in more complex source code. https://go.dev/play/p/dsY6tK5S8Ie Better generics and improved SI…

Funny enough, in one of my projects I created a struct with a string field just to have a distinct type that couldn't accidentally be initialized by typing a string. This update completely messes that up lol

Re: Go 1.27

#247
post #59

Earlier quoted context omitted.

There's a reason for this. Rob Pike was asked about it and said that syntax highlighting reminds him of the bright colors of children's toys and he personally disables it so that he can focus on the text. I don't know why it's still like that but that's the original reasoning.

> Syntax highlighting is juvenile. When I was a child, I was taught arithmetic using colored rods ( http://en.wikipedia.org/wiki/Cuisenaire_rods ). I grew up and today I use monochromatic numerals. https://groups.google.com/g/golang-nuts/c/hJHCAaiL0so/m/kG3B...

this is hilarious

Re: Go 1.27

#248

> Second, a key in a struct literal may now be any valid field selector for the struct type, allowing fields in nested or embedded structs to be initialized directly It's been a while since I've written more than anything trivial in golang, but this seems like a big deal to me. As in, I can define a struct that is consistent and reusable in other structs

If I'm being honest, I actually hate this feature. I like things being obvious, and structs were always something I could rely on being very explicit.

Re: Go 1.27

#249
post #204

Earlier quoted context omitted.

I still believe that SIMD support is one of the most underrated new features in Go. It's relatively straightforward to read and to write code using Go's SIMD package (the caveat being that you have to convert your data to SoA manually), and it gives comparable performance to other languages, since there's little in the way of GC overhead, bounds checking, etc, in this case. So SIMD not only increases performance on i…

Are rewrites from Go to Rust for performance reasons really that common?

I think it only really happens when companies run into GC problems

Re: Go 1.27

#250
post #204

Earlier quoted context omitted.

Are rewrites from Go to Rust for performance reasons really that common?

Hard to say tbh, but there are some high-profile examples, e.g. from Discord: https://discord.com/blog/why-discord-is-switching-from-go-to...

This was one of the times where it made some sense. A lot of their complaints were about GC, which Discord has had issues with in the past on other things. Notably, Discord switched from Cassandra to ScyllaDB for their messages, and cited the Java GC as a big reason.
Post reply on HN