3 ms·
> Error handling and learning are respondents’ top challenges. Historically, lack of generics was the biggest challenge to using Go, but since the introduction
by doodlesdev 3y ago
> Error handling and learning are respondents’ top challenges. Historically, lack of generics was the biggest challenge to using Go, but since the introduction of generics, we’ve seen comments about generics decline. Comments about error handling (with respect to readability and verbosity) and difficulty learning best practices are now the most commonly reported challenges.
If the past debacle with generics is considered, I think Golang might be getting (real) error handling soon..... If that's a good thing or not, I'll let developers who use the language to determine. As an outsider to the Golang ecosystem I see the language almost ridiculous simplicity as one of its main selling points, it's the kind of language like C where I see any new features as something to be avoided, specially if it's paradigm-changing.
- thiht 3y agoHonestly I hope they won't break the simplicity of error handling as it is today. It sucks, but it's explicit, simple to understand and ubiquitous: everyone does it the same because there's no choice. Results/Options would have been a better choice from the ground up but it's too late for that, as nothing would be worse than having 2 official ways to handle errors. The single change I would like is being able to inline my iferrs like this: if err != nil { return err } For simple cases where there's no need to log or do extra stuff it would be convenient. Goland already shows the iferrs like this.