Live data from Hacker News

Why Go is my favorite programming language

michael.stapelberg.de

121–130 of 256 posts

Re: Why Go is my favorite programming language

#121

Earlier quoted context omitted.

After having coded tens of thousands of lines in Golang for 4 years, there are a list of probably hundreds of grievances I have about the language itself. The problem is that they're generally outweighed by the simplicity, consistency, and clarity of the language. Is the error system terrible? Obviously. Lack of abstract data types? Awful. Is Rust one thousand fold safer and more syntactically powerful by comparison?…

Why learn a new language just to learn a new language for production stuff? I looked at at switching to Go from Java for my flagship product. I couldn't find enough compelling reasons to switch. It didn't offer enough benefits to outweigh the benefits of Java + Spring Boot. As a result, Java it is. Now for a new product that I might sell as traditional installed software, Go makes some sense here since it simplifies…

> My clients wouldn't need to install and maintain the VM

Why should they?

One can always deliver everything together.

Not much different than static linking.

Also there are AOT compilers and with Java 9 we are getting a linker to create customized JREs.

Re: Why Go is my favorite programming language

#122

Earlier quoted context omitted.

> Go, with its lack of complicated mechanics targets the middle of the bell curve. No, it targets the less experienced - interns, as the language creators said.

I don't think Go targets the less experienced. Could you provide a resource, where the language creators have stated that Go targets interns? Go is a safe programming language, but it is not simple. Go has very rigid rules. I don't see any difference in complexity between programming in C and programming in Golang. Programming in Golang may even be harder than C. If you format your code wrong, Golang screams at you.…

You just gave some reasons why correctly programming in Go is easier than in C, like paint by the numbers or training wheels (restrictions) versus a blank canvas; it's easier to make mistakes in C, ergo harder to program in. Golang screaming at you is like having a coach.

Re: Why Go is my favorite programming language

#123
post #26
post #21

I have said it before and I will say it again - for all the deficiencies Go has, it is somehow highly compatible with the way my brain works. One point the article does not mention is the documentation. I think Go's documentation is excellent, it does not overwhelm the reader with its volume, but mostly anything one might want to know about the syntax and semantic can be answered by carefully reading through the docu…

I still do not see why somebody in their right mind would willingly prefer camelCase over using_underscore My taste is the opposite: I can't understand underscores in identifiers, it's like having hiccups inside every thought. But what saddens me is that we're still having this conversation in 2017. It would be trivial for editors to support either style, if only language designs included the concept of word separato…

Nim allows either style in the language directly: https://nim-lang.org/docs/manual.html#lexical-analysis-ident...

Re: Why Go is my favorite programming language

#124

Earlier quoted context omitted.

> Go, with its lack of complicated mechanics targets the middle of the bell curve. No, it targets the less experienced - interns, as the language creators said.

I don't think Go targets the less experienced. Could you provide a resource, where the language creators have stated that Go targets interns? Go is a safe programming language, but it is not simple. Go has very rigid rules. I don't see any difference in complexity between programming in C and programming in Golang. Programming in Golang may even be harder than C. If you format your code wrong, Golang screams at you.…

There is a Go talk where Rob Pike states that.

EDIT:

Found it, https://talks.golang.org/2012/splash.article

"It must be familiar, roughly C-like. Programmers working at Google are early in their careers and are most familiar with procedural languages, particularly from the C family. The need to get programmers productive quickly in a new language means that the language cannot be too radical."

Re: Why Go is my favorite programming language

#125

> There is a cost to introducing an abstraction layer. Go code is usually rather clear, at the cost of being a bit repetitive at times. Go programmers say this a lot and every time I see it I wince. We've had all sorts of flights of fashion and fancy in the programming world, but one observation has emerged that seems closer to fact every time we test it: more code is more bugs. The more code you write, the more chan…

As Sandy Metz once said, "A little duplication is far better than the wrong abstraction."

After a decade of OOP indoctrination and misuse, we see the results of this.

> Go has popularized a mode of writing code where not only are abstractions unwelcome, but they're nearly impossible

This lends me to believe you actually haven't written any go code for yourself. This is the same thing every OOP-indoctrinated developer (Usually Java or C#) has said before. I came from those languages, and this statement is categorically false and completely unfounded in reality.

Re: Why Go is my favorite programming language

#126
post #101
post #84

Earlier quoted context omitted.

Google doesn't invest heavily in Go. It almost certainly invests more in JS, Python, Java, and C++. I think the difference is philosophical--Go doesn't pretend that every obscure edge case deserves equal support to the main case, and so its tooling is much simpler.

I'm not sure where you get your information from, but Google definitely invests a substantial amount in Go. - Paid some of the most celebrated engineers to work on it full time. - Support it as a first class language in GCP - Support it as a first class language internally If you want to see a language Google doesn't invest much into, look at Dart

Even dart has substantial investment. Look at flutter, the new cross-platform ui toolkit for dart, and its use in Fuchsia.

Re: Why Go is my favorite programming language

#127

> There is a cost to introducing an abstraction layer. Go code is usually rather clear, at the cost of being a bit repetitive at times. Go programmers say this a lot and every time I see it I wince. We've had all sorts of flights of fashion and fancy in the programming world, but one observation has emerged that seems closer to fact every time we test it: more code is more bugs. The more code you write, the more chan…

Regarding your last paragraph, it's a reflection of the state of the industry. The vast majority of "software engineers"/"full stack developers" can't be bothered to learn new skills or improve their existing ones, so any popular programming tool is stuck catering to the least common denominator.

Do you carefully review your own code? Do you voluntarily learn any new skill beyond "blog post intro tutorial" level? Do you think about the consequences of a change you make beyond the immediate need it addresses? Congratulations: Regardless of talent, you're already better than ~90% of professional programmers. You're a "10x developer" by virtue of the fact that by a reasonable baseline of quality the remainder are "0.1x developers" or worse.

I don't think that Google is wrong to focus on mitigating the damage that the majority of engineers will inflict on a codebase. In fact it's depressing how right they are, and what the realities of software engineering look like at scale. It confuses me though that small teams select tools built to solve those problems.

Re: Why Go is my favorite programming language

#128

Earlier quoted context omitted.

Why learn a new language just to learn a new language for production stuff? I looked at at switching to Go from Java for my flagship product. I couldn't find enough compelling reasons to switch. It didn't offer enough benefits to outweigh the benefits of Java + Spring Boot. As a result, Java it is. Now for a new product that I might sell as traditional installed software, Go makes some sense here since it simplifies…

My team just chose golang instead of java or dotnet core for a new crud app. I'm not especially fond of go, but mean length of feedback loops are worth it (so far). We have a bunch of tests, and they all run in a few hundredths of a second. Same coverage in java is usually several seconds at least. Often up to 30s if running tests with maven. Standing up the app is also instantaneous. Spring boot apps with hibernate…

There are lighter options in java world, my dropwizard server with JDBI starts in 1.2sec.

Re: Why Go is my favorite programming language

#129
post #70

Earlier quoted context omitted.

Yes, my impression is that Go was created partly to be used in corporate environments to replace Java with a less verbose language that scaled well, and it seems to be doing well in that regard.

Sadly, it ends up far more verbose than Java when you have (as I did after trying to port a project from java to go) over 200 copies of the same observable, sorted, copy-on-write set implementation, because Go doesn’t have generics. And then you change one thing in one place, and gotta change it everywhere again. No thanks.

Surely you could have used interfaces for this case, no?

Re: Why Go is my favorite programming language

#130

> There is a cost to introducing an abstraction layer. Go code is usually rather clear, at the cost of being a bit repetitive at times. Go programmers say this a lot and every time I see it I wince. We've had all sorts of flights of fashion and fancy in the programming world, but one observation has emerged that seems closer to fact every time we test it: more code is more bugs. The more code you write, the more chan…

As Sandy Metz once said, "A little duplication is far better than the wrong abstraction." After a decade of OOP indoctrination and misuse, we see the results of this. > Go has popularized a mode of writing code where not only are abstractions unwelcome, but they're nearly impossible This lends me to believe you actually haven't written any go code for yourself. This is the same thing every OOP-indoctrinated developer…

> After a decade of OOP indoctrination and misuse, we see the results of this.

Sure, but that's OO's fault and the lesson is not "abstractions are bad" but rather, "OO's good at domain abstractions and bad at universal abstractions."

The takeaway should not be to discard the last 12 years of advances in computer science and call it quits with a bad copy of Erlang's concurrency model and a weak version of C.

> This lends me to believe you actually haven't written any go code for yourself.

I've written about 5000 lines. So not a ton, but enough to have shipped Go to prod and be capable of reading it.

> This is the same thing every OOP-indoctrinated developer (Usually Java or C#) has said before.

Go is more OOP-focused with its weak interface{} methodology than anything I promote or have used joyfully in the last 6 years. Even the most cursory examination of my presence will reveal that.

Please don't put words in my mouth to tidy your argument.

Post reply on HN