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.
Go 1.27
241–250 of 277 posts
Re: Go 1.27
#242Earlier 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 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
#243I 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…
Re: Go 1.27
#244Re: Go 1.27
#245Brace 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?
Re: Go 1.27
#246Struct 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…
Re: Go 1.27
#247Earlier 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...
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
Re: Go 1.27
#249Earlier 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?
Re: Go 1.27
#250Earlier 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...