top | item 46865653

(no title)

DoctorOW | 27 days ago

I'm going to be honest, I always felt like the verbosity was the point of Go. Iirc the whole reason it was invented was to let codebases be as readable as they are writable even for less experienced developers. Why are there Error types when exceptions exist? To force you to acknowledge the possibility for errors. You can easily let your frameworks and libraries handle recovering from panics, but err is unavoidable. You have to, at the very least, put the _.

discuss

order

cwillu|26 days ago

Which is great until you have to troubleshoot an error code surfaced by a nasty web of code with no idea where it came from because the simplest way to handle err is to re-return it, optionally (and more or less uselessly) wrapping it in a new err. I'll take a panic with a stack trace over that any day.

bccdee|26 days ago

The trouble with Go is that, because the language is so simple, the obvious way to do a thing always has a bunch of drawbacks. Taking care of gotchas at a language level means complicating the language, but refusing to do so means complicating code written in your language.

There's a balance to be struck here, but Go is stingy, so you don't get things like error traces and automatic destructors and const semantics even when they would make Go a much simpler language to use.