News for hackers. Stuff that matters.
Re:Go Replaces Interface{} with 'Any' by papito on Tuesday December 14, 2021 @05:13PM (#29558796)
People downvote it, but it's true. 2/3 of your Go code is `if err` blocks. And the way you have to chain the error messages to make the stack make any kind of sense is just maddening.
Re:Go Replaces Interface{} with 'Any' by Vanclief on Tuesday December 14, 2021 @05:27PM (#29558979)
I used to really hate that. After reading this amazing post https://middlemost.com/failure-is-your-domain I created a module that makes this bearable https://github.com/Vanclief/ez
Re:Go Replaces Interface{} with 'Any' by neop1x on Wednesday December 15, 2021 @03:26AM (#29563336)
We often have errors handled. In contrast to many Java codes just spitting unhandled exception stacktraces or crashing completely.
Re:Go Replaces Interface{} with 'Any' by papito on Wednesday December 15, 2021 @09:12AM (#29566150)
You must handle an exception in a language like Java. Yes, you can just print the stacktrace, but that is a choice. I don't HAVE to handle errors in Go until the program crashes as well. I never really understood that argument.