4 ms·
> There is one thing in Go, that I haven't met anywhere else. I can really understand any codebase I stumble upon in a matter of seconds. Care to elaborate a b
by pka 10y ago
> There is one thing in Go, that I haven't met anywhere else. I can really understand any codebase I stumble upon in a matter of seconds.
Care to elaborate a bit more?
I understand that when you see for(...) { b[i] = f(a[i]); } then you instinctively know that it's a loop that maps over some sequence, and so on. But let's say you have a 50-100kloc codebase with a 100 files in it. In what unique to Go way does Go help you understand the big picture/coarse architecture of such a project?
- cube2222 10y agoOh, that it doesn't. I meant smaller parts of code, and not for loops actually. (I prefer maps, filters etc.). Things like gofmt and the simplicity (in that, small number of concepts) of the language lead to most people writing fairly idiomatic code. This way most codebases look the same and you read each other's code as it were yours.
- matwood 10y agoI'm just getting into Go and have found what you said to be true. It's easy to read other people's code on GH (Java is much the same way). Compare that to something like Scala, where no ones code looks the same.
- cube2222 10y agoCheck out sourcegraph, it's great for reading Go and Java code and has a GitHub integration.
- Elrac 10y agoI'd like to echo what you said. I tend to be a victim of analysis paralysis, spending hours thinking up the most clever design. Go offers far fewer alternatives so there goes the temptation. Given a smallish task, I simply sit down and grind out code, and a couple of thousand lines later I have a simple, self-contained executable that does what I wanted to do. I feel there's a kind of magic in Go's brute simplicity.
- kasey_junk 10y agoHonestly the biggest thing go has going for it is gofmt. Its one of the few things I miss when I work with other languages.
- cube2222 10y agoI think it may actually be the thing I miss the most. (together with implicit interfaces)
- efdee 10y agoDoesn't every semi-decent IDE have an option to reformat your code? What makes gofmt so special?
- cube2222 10y agoThat all code is written the same from the get-go, and you can readily browse it in places like github, etc.
- kasey_junk 10y agoNo external choices the language dictates style. It ships with the sdk & contributors are expected to use it so there is a cultural agreement out of the box. It's a cli tool so it's immensely scriptable and easy to integrate.
- AlphaSite 10y agoMy biggest problem with it is implicit interface. I genuinely despise that about it.
- cube2222 10y agoWhy don't you like implicit interfaces, it's the feature I love the most actually?
- tonyedgecombe 10y agoI like it as well although I can see there would be times when you might want to be explicit.
- cube2222 10y agoI understand, but why would it be the greatest issue to despise, I'm just curious.