www.infoworld.com
Go Has Extra Error Handling
In 2007, some of the programmers at Google looked at their options for writing software and didn’t like what they saw. They needed to manage millions of lines of code that would be constantly storing and shipping data for the world wide web. The code would juggle thousands or maybe millions of connections on networks throughout the globe. … What some developers love about Go, others hate just as much. \n8 reasons developers love or hate the Go language\n\nIt's easy to learn\nIt doesn't play favorites\nThe C-based syntax\n(Too) many rules\nExtra error handling\nThe standard library\nThe executable size\nBig daddy Google\n\nGo is easy to learn\nGo's designers deliberately created a language that would be quick to learn, because it didn’t have too many complex features or idiosyncrasies. … Would a witch choose an abridged spell book? Would a quarterback choose a playbook with just a few plays? Some coders feel that programming with Go is like coding with one hand tied behind their back. The language lacks all the cleverness other language designers have delivered to the world, and that's a high price to pay.\nGo doesn't play favorites\nThe original developers wanted to create a small language, and they did so at the expense of many favorite features found in other languages. … There are no curly punctuation marks to delineate blocks of code and the typing is deliberately dynamic. Anyone who loves the Python approach will find plenty to dislike about Go. From this perspective, programming with Go feels like a step or three backward.\nGo has (too) many rules\nFrom the beginning, Go's creators wanted to define not just the syntax but also much of the style and usage patterns of the language. … There’s even a separate type system for errors that allows programmers to create more specific forms of errors, then spell out how they should be handled.\nWhy some love it: The Go approach acknowledges that errors exist and encourages the programmer to make a plan for handling them. This encourages programmers to plan ahead and build in the kind of resilience that makes for better software.\nWhy some hate it: Unnecessary error handling makes Go functions fatter and harder to understand. … Problems like vendor lockin and lack of control are serious issues for anyone trying to curate a tech stack. All of Google’s generosity still leaves programmers leery, especially when other language choices have large, open source communities built around them.
Related Pain Points3件
Error handling patterns are verbose and outdated
7Go's repetitive if err != nil pattern is seen as verbose boilerplate compared to modern error handling in Rust and TypeScript. Developers report fatigue and decreased productivity in large codebases, and 28% of survey respondents want language features for better error handling.
Go lacks modern language features like generics, enums, and pattern matching
728% of developers want language features missing from Go that are available in other languages. Common requests include proper enums, union types, sum types, pattern matching, and nil pointer safety. Existing generics are criticized as half-baked.
Vendor Lock-in Concerns Due to Google Stewardship
4Developers express concerns about potential vendor lock-in and lack of control given that Go is primarily controlled by Google. This is seen as problematic compared to languages with large, independent open-source communities.