News for hackers. Stuff that matters.
Re:Go 1.20 Released by politician on Wednesday February 01, 2023 @07:01PM (#34620061)
math/rand: The original behavior never bothered me and actually motivated deterministic tests. File this under "won't be bothered to read the docs", I guess.
Re:Go 1.20 Released by thiht on Thursday February 02, 2023 @05:45AM (#34624834)
> File this under "won't be bothered to read the docs"

Do you read the docs of every basic feature you use? When you call a rand function, you usually expect it to be seeded. In any language, I'll only read the docs of a rand function to know how it handles bounds. You still can seed it manually in your tests if you want a deterministic behavior.

It's like if you used `time.Now()` only to discover that you first have to call `time.StartClock()` for it to work as expected, it can make sense but is not the commonly expected behavior.

Re:Go 1.20 Released by indil on Thursday February 02, 2023 @11:26PM (#34637135)
>Do you read the docs of every basic feature you use?

Yes? You don't?

Re:Go 1.20 Released by thiht on Friday February 03, 2023 @03:45AM (#34638808)
No.
Re:Go 1.20 Released by politician on Friday February 03, 2023 @11:29AM (#34643352)
Yes, I do. All languages have weird corner cases in the standard libraries, and third-party dependencies have even worse edge cases. "Plug and play" rarely works for me, and it's better to know how something you plan to rely on in a production environment works, then to just assume it will work.