News for hackers. Stuff that matters.
Re:Fixing for Loops in Go 1.22 by FridgeSeal on Tuesday September 19, 2023 @05:47PM (#37577275)
Sum/Product types. Generics/type-parameters. Bizarre handling of nil in places. Error handling that’s like some deliberately crippled version of a Result<T,E>. The absolutely unhinged decision about zero-value-defaults for types. I’m sure other people can think of some more, but that’s the ones I can think of off the top of my head.

Non PL theory but related: incorrect implementation of monotonic clocks, and then refusing to fix it because “just use google smear time bro”.

Re:Fixing for Loops in Go 1.22 by skybrian on Tuesday September 19, 2023 @06:09PM (#37577613)
Everyone who disagrees with you is “unhinged.” This is just name-calling.
Re:Fixing for Loops in Go 1.22 by FridgeSeal on Wednesday September 20, 2023 @06:58AM (#37582677)
But they’re like, genuinely wild decisions? Unhinged is a great description!

The error design can return the value, or an error, or both, for some inexplicable reason and you can check it - or not - and if your function returned some indication of severe error, and you happen to not check it, you can totes just continue your program, in who knows what invalid state. Oh and also, because the devs are apparently deathly allergic to abstractions of apparently kind, you’ve got to do this janky little if err != nil check at. every. single. point. Which occludes your fundamentally important logic in pointless line noise, with zero opportunity for streamlining or improving the logic or guarantees.

Re:Fixing for Loops in Go 1.22 by kiitos on Tuesday September 19, 2023 @09:31PM (#37579405)
Go definitely implements monotonic clocks correctly?

https://pkg.go.dev/time#hdr-Monotonic_Clocks

Re:Fixing for Loops in Go 1.22 by FridgeSeal on Tuesday September 19, 2023 @09:48PM (#37579500)
Re:Fixing for Loops in Go 1.22 by kiitos on Wednesday September 20, 2023 @01:21AM (#37580635)
That article is so cringeworthy
Re:Fixing for Loops in Go 1.22 by FridgeSeal on Wednesday September 20, 2023 @06:59AM (#37582682)
I disagree, but the style isn’t for everyone.

However, that still doesn’t mean that it’s wrong.

Re:Fixing for Loops in Go 1.22 by eviks on Saturday September 23, 2023 @05:52AM (#37621885)
Rather illustrative article, especially re the false simplicity where the language just silently does the wrong thing

(though I disagree that ".ext" is not an extension of an empty base name)