Software Alternatives & Reviews

Go’ing Insane: Endless Error Handling

OCaml Medium
  1. 1
    (* Binary tree with leaves carrying an integer.
    Pricing:
    • Open Source

    #Programming Language #OOP #Generic Programming Language 30 social mentions

  2. 2
    Welcome to Medium, a place to read, write, and interact with the stories that matter most to you.
    Pricing:
    • Open Source
    > Have a look at the source code of the top 10 go github repos, you won't find any of what the blog post talks about, because it simply isn't the way it's done A quick look around k8s certainly shows evidence of lots of boilerplate-y error handling. To give my perspective, I come from a primarily python background, but have used C++ and JS enough to know my way around, and Java was what I primarily learned programming in. I write relatively little go, but I review a fair amount of it. The people whose code I'm reviewing are competent, idiomatic go programmers who follow go's style guide (https://github.com/golang/go/wiki/CodeReviewComments) to the extent that it exists. I find it far more difficult to tease out what a stanza of go is doing compared to an equivalent stanza of python due to the visual noise. In python (and other languages), I usually use a somewhat functional/declarative style, so I use abstractions like comprehensions and such to allow terse transformations of data. Go doesn't have these. In essence, the tradeoff go makes is to not provide abstractions in the language. This forces users to recreate them[1] ad-hoc, or suffer without abstractions at all (which doesn't scale). This makes everyone suffer, instead of just people unfamiliar with the abstractions suffer. [1]: https://medium.com/@robertgrosse/parallelizing-enjarify-in-go-and-rust-21055d64af7e#.7vrcc2iaf, and yeah yeah yeah go finally is getting generics, but the same general comment applies to other common and useful abstractions. Error handling, functional stuff, take your pick.

    #Blogging #Blogging Platform #CMS 2211 social mentions

Discuss: Go’ing Insane: Endless Error Handling

Log in or Post with