I think the mistake may be assuming that Go is meant to be a general-purpose language. From what I can tell, it's purpose-built to be a "web services" language, and its design-decisions center around that. What does that mean? - It's expected to be run on Linux servers (not Windows) and developer workstations (probably not Windows). - It needs to be fast but not blisteringly fast. Micro-performance concerns like the…
I Want Off Mr. Golang's Wild Ride
281–290 of 508 posts
Re: I Want Off Mr. Golang's Wild Ride
#282Re: I Want Off Mr. Golang's Wild Ride
#283Earlier quoted context omitted.
> Well you should handle the error in the first place. That's like saying you should just write bug-free code in the first place.
Go goes out of its way to ensure you handle the error. You have to do something with that err return, otherwise it's a compile error. If you're just throwing it away without checking, we've gone from the mere mistakes everyday developers make to irresponsibility. There's a reason most go code is littered with "if err != nil" on nearly all function calls.
fmt.Println("foo")
You're not forced to handle the error. Not to mention more obscure cases like a, err1 := foo()
if err1 != nil { return err1 }
b, err2 := bar()
if err2 != nil { return err1 } // bugRe: I Want Off Mr. Golang's Wild Ride
#284Earlier quoted context omitted.
He presented them as typical examples, not as issues of such importance as to independently make him off the "wild ride." He also compared them to alternatives that he found favorable, which specifically addresses the idea that alternatives are worse. It could be reasonable to disagree with the content of his argument, but it didn't have either of these structural problems.
> it didn't have either of these structural problems. Disagree...the volume/importance of grievances should be directly proportional to willingness to abandon. That a few examples can be provided isn't an indictment of the ecosystem anymore than it would be if I did the same to those the OP found favorable.
I haven't used much Go, but the bit that I've played with gave me the distinct impression that "opinionated simplification" wasn't just common, it was the defining quality of the entire language, which would strongly suggest that OP's complaint would easily generalize to a hundred other APIs. Is that not the case?
Re: I Want Off Mr. Golang's Wild Ride
#285Earlier quoted context omitted.
Go does absolutely nothing to ensure you handle the error. The only thing in Go source code that you see more often than the boiler plate "if err != nil" is "a, _ = foo()". It's all too easy to ignore an error in Go.
> Go does absolutely nothing to ensure you handle the error. Go has many community linters available, https://github.com/kisielk/errcheck is popular for checking unhandled errors. If you'd like a combo-pack, check out https://github.com/golangci/golangci-lint which includes all of the popular linters in a configurable way.
Re: I Want Off Mr. Golang's Wild Ride
#286Earlier quoted context omitted.
It's curious that after pretty universally rejecting checked exceptions, they have now returned as result.
Result types are genericizable in a way that checked exceptions aren't (IIRC), which is huge for ergonomics.
Re: I Want Off Mr. Golang's Wild Ride
#287Earlier quoted context omitted.
Go does absolutely nothing to ensure you handle the error. The only thing in Go source code that you see more often than the boiler plate "if err != nil" is "a, _ = foo()". It's all too easy to ignore an error in Go.
This is fud, I've never seen in Go code people dropping the err with _. The reason why you don't see that is because you have to be explicit about that, it's not something you forget it's done on purpose which obviously no one does.
Re: I Want Off Mr. Golang's Wild Ride
#288Earlier quoted context omitted.
This. I like, and agree, with the conclusion, and wish more people would get to it: > Over and over, Go is a victim of its own mantra - “simplicity”. (...) > It constantly lies about how complicated real-world systems are, and optimize for the 90% case, ignoring correctness. > This fake “simplicity” runs deep in the Go ecosystem. I've always liked simplicity and on my own design, I tend to go for abstraction; trying…
A post about fixing Date in JavaScript got me thinking about why it took so long for languages to get good date/time APIs. I think it's because it took so long to accept that date and time really is complicated. If you sit down and work it out carefully, you end up with Joda-Time (more or less - not in all the details, but in the set of abstractions). If you balk at that and make something simpler, you make a subtly…
It turns out that abstractions for time are really hard to get right.
Re: I Want Off Mr. Golang's Wild Ride
#289Earlier quoted context omitted.
I surprises me that most people here aren't up in arms in agreement with this point. Code that is silently incorrect is an absolute disaster on an enterprise level. I spend a lot of time writing seemingly redundant double and triple error checking into my code, only to have the designers of the LANGUAGE say, "yeah, most filepaths are utf-8 so seems good enough to me".
Isn't that the standard library and not the language?
Re: I Want Off Mr. Golang's Wild Ride
#290Earlier quoted context omitted.
Erlang is a stable language that has been around for a long time (almost 35 years now). It's used for way more mission-critical code than golang is ever likely to be used for. It's weird syntax and performance tradeoffs are very well known, but you still won't see anywhere near the number of complaints that you see against golang.
Erlang is less and less used in telecoms and it's the only place if was really used, lot of things have switch to C/C++/Java. As for the reason why it has less complains it's pretty simple no one uses Erlang and it's a niche, it's not a generic purpose language. I can't even tell a single known application or library written in Erlang.