Re:Lies we tell ourselves to keep using Golang
by clausecker on Tuesday November 26, 2024 @04:55AM
(#42244148)
I dislike sum-type based error handling. It is annoying syntactically and only really doable with lots of high-level combinators, which in turn hinder debuggability.
[ Parent
| on HN ]
Re:Lies we tell ourselves to keep using Golang
by lionkor on Tuesday November 26, 2024 @08:52AM
(#42245714)
Have you tried the approach that Zig has, or the approach that Rust has? They are easy to debug and do not use any crazy stuff, just simple syntax like `try x()` (Zig) or `x()?` (Rust)
Re:Lies we tell ourselves to keep using Golang
by clausecker on Tuesday November 26, 2024 @05:52PM
(#42251006)
Yes and that syntax sucks.
Re:Lies we tell ourselves to keep using Golang
by lionkor on Wednesday November 27, 2024 @02:00AM
(#42253648)
That sounds like your opinion rather than a "it sucks because it encouraged bad practices" or something
Re:Lies we tell ourselves to keep using Golang
by clausecker on Sunday December 01, 2024 @08:23AM
(#42288331)
if err != nil { return err; } is an antipattern. Codifying it through builtin constructs does not change this, but instead encourages such poor error handling. That's why try sucks.