3 ms·
The post mentioned a few things that Go has done that seem to be "obvious" choices today: - automatic formatting - unified tooling - module/library support
by oconnor663 3y ago
The post mentioned a few things that Go has done that seem to be "obvious" choices today:
- automatic formatting
- unified tooling
- module/library support
I'd add more items to that list, which aren't unique to Go of course, but where Go has clearly contributed to the new consensus:
- composition over inheritance
- compiling to native binaries
- error values over exceptions
- array slicing
- no automatic integer type conversions
There's plenty I don't like about Go, and I rant about it sometimes, but I also respect it. It moved the art forward.
...now can I please compile my code with unused variables when I'm deliberately trying to make my tests fail? :-D
- pitaj 3y agoInterestingly, all of those (except for automatic formatting) also apply equally to Rust. Maybe that's why there's such a "Go vs Rust" culture.
- tubthumper8 3y agoRust also has automatic formatting [0] I don't think the tooling is why there is a perceived "Go vs Rust" culture, I think that's due to (somewhat) overlapping use cases, or more probably that they were developed and came out around roughly the same time. There really doesn't need to be a "Go vs Rust" culture though. I think it should be obvious to most people that Go had a big influence on Rust and other modern languages for the benefit of having unified tooling, formatter, linter, etc. [0] https://www.rust-lang.org/tools https://www.rust-lang.org/tools
- pitaj 3y agoIt's my understanding that the Go compiler will format your code every time you compile. For Rust, its a separate tool invocation.
- masklinn 3y ago> It's my understanding that the Go compiler will format your code every time you compile. I do not believe that is the case. You have to invoke `gofmt` or `go fmt` on the project. You may hook it to precommit, or your editor might be configured to automatically run it on save, but afaik neither `go build` nor `go run` will auto-format.
- bananapub 3y ago> It's my understanding that the Go compiler will format your code every time you compile. incorrect. perhaps you're mixing that up with your editor doing it on save. > For Rust, its a separate tool invocation. literally go has gofmt and rust has rustfmt.
- commandersaki 3y agoSo pretty much everything I despise about Java.