3 ms·
I just got into Go, and I'm a fan a lot of language design decisions. But a lot of configuration leaves me wondering: is it me who doesn't understand something,
by golergka 11y ago
I just got into Go, and I'm a fan a lot of language design decisions. But a lot of configuration leaves me wondering: is it me who doesn't understand something, or did the same folks who designed such a good language actually screwed up configuration stuff?
No way to specify a version of library or language I'm working with is already a little bit annoying, although I haven't actually discovered problems because of it. But the $GOPATH just drives me nuts: why the hell would the language infrastructure work out of assumption that all my projects that are based on a single language are contained in a single folder? On the contrary, I often have projects that include several different languages and frameworks in them, and I'm usually keeping client and server in the same repo. Language is a part of a project, not the other way around. I ended up with this hackery in my server Makefile:
build:
GOPATH=$(shell pwd) go install main
Overall, just as Go itself is transparent and simple, it's `import` statement and build infrastructure is not. "Convention over configuration" may be a good approach for simple web apps, but when this convention just doesn't fit your workflow, it brings more bad than good.
- Cthulhu_ 11y agoThe idea with using $GOPATH is due to go having its own packaging tool; in other systems, you often see something similar (Maven for Java is probably the largest one), i.e. a directory structure somewhere. The $GOPATH makes it a lot easier to contribute on other packages though, you can just jump in there because it's right next to your own project/packages.
- eternalban 11y agoMy opinion: What they got right is what Rob e.g. concurrency, better C, etc., had figured out (so it was version n). Other stuff he apparently doesn't understand at the same level (e.g. [type systems, versioning,] hard coding repo locations in package imports <head smack>) ... [edit]
- golergka 11y agoCould you elaborate more about type systems? I don't have a definite opinion about Go's type systems so far, and it surely has it quirks, but TBH, I like the concepts. In particular, the complete separation of data types (structs) and behaviour types (interfaces) is something that I've never actually seen before.
- eternalban 11y agoThat horse has been beaten to death elsewhere. Go is [a] sweet language, don't get me wrong, but it is a mixed bag of extreme brilliance ('select') & head-scratching wtfs (OP). Interfaces are hardly new. Go's novel take is the 'auto-morphism'[1] of types that (happen) to implement the function set aggregated in an interface. And this approach has its strengths and its weaknesses. [1]: ok, I made that up.
- kamatsuoka 11y agoI'd hazard a guess that it reflects Google's approach to dependency management. Internally, Google only uses a single version of any library. If you want to update your version of library X, you have to go around and make sure that every project that depends on X works with the new version of X.