4 ms·
What's not so great about Golang: -error handling is kinda ugly and verbose -no generics -interfaces are done through duck typing -null pointers -int size
by fnord77 6y ago
What's not so great about Golang:
-error handling is kinda ugly and verbose
-no generics
-interfaces are done through duck typing
-null pointers
-int size is platform dependent
-no built-in immutability
- rgoulter 6y agoA point I don't see mentioned often enough is a couple of points about the compiler's poor DX for iterative development. Go will fail to build if you have unused dependencies or variables. (And it's easy to use the convenient `:=` in a way which faces problems exacerbated by this). If I'm debugging through something, I might be adding packages or intermediate calculations to try and figure out what's going wrong. But because the Go compiler enforces this proper style of "nothing unused", there's that much more friction when tinkering.
- papaf 6y agoI highly recommend using goimports to format your code on save: https://godoc.org/golang.org/x/tools/cmd/goimports https://godoc.org/golang.org/x/tools/cmd/goimports This will hopefully reduce some of the friction you are having.
- kortex 6y agoWhat's great about "not so great about Golang" posts: - it's the exact same 4-6 criticisms every single time - "no generics" is on the chopping block
- blandflakes 6y ago> - it's the exact same 4-6 criticisms every single time This isn't necessarily an argument that those criticisms are wrong, though.
- duckmysick 6y agoIt's the exact same criticisms every single time about other languages too. Unsafe C, slow Python, verbose Java, messy JavaScript ecosystem, etc. When criticism is valid, it doesn't matter if it's novel or not.
- apta 6y ago> verbose Java Ironically, golang codebases tend to be more verbose than Java.
- Cthulhu_ 6y agoThey've traded horizontal verbosity for vertical; you probably won't find a `SimpleBeanFactoryAwareAspectInstanceFactory` in Go; instead you'll probably find a long list of functions implementing some interface (`Stringer`, `Valuer`, etc). I want to make a pasta comparison but can't think of a good one for Go, since it's often quite straightforward / not-spaghetti. Java is often lasagna code though.
- nickm12 6y agoWell, there's a lot more than that: https://github.com/ksimka/go-is-not-good https://github.com/ksimka/go-is-not-good
- sjansen 6y agoAll of this is true, and yet Go is going from strength to strength because sometimes "worse is better". https://en.wikipedia.org/wiki/Worse_is_better https://en.wikipedia.org/wiki/Worse_is_better