News for hackers. Stuff that matters.
Re:Good-bye core types; Hello Go as we know and love it by dharmab on Wednesday March 26, 2025 @05:37PM (#43487650)
I would have preferred a Result type.
Re:Good-bye core types; Hello Go as we know and love it by elvlysh on Wednesday March 26, 2025 @09:08PM (#43489389)
So you would prefer to write match result => error instead of if err != nil? Excuse me for not being convinced that this isn't just fussing over syntax.
Re:Good-bye core types; Hello Go as we know and love it by valenterry on Wednesday March 26, 2025 @11:51PM (#43490240)
If a language supports Result types, that usually means it also comes with some kind of syntax to use it. Check out some Rust code (or Haskell, Scala, F#, ...) and you will find that in those languages you barely match in the result because you don't have to. Whereas you have to do "if err != nil" in golang all the time.
Re:Good-bye core types; Hello Go as we know and love it by stouset on Thursday March 27, 2025 @02:28AM (#43490887)
It isn’t just fussing over syntax, but that would require you actually being curious enough to learn why instead of needing to dismiss people’s valid critiques of out hand.
Re:Good-bye core types; Hello Go as we know and love it by tubthumper8 on Thursday March 27, 2025 @12:08PM (#43495065)
It's not just syntax, a sum type forces checking for the error whereas a product type does not, so it's a semantic distinction too