Hello. I am learing Go and again I found something that worries me. I would appreciate your comments about this question I found. Link
Is golang good for real world web apps?
No. Golang definitely has a place in web application infrastructure/architecture, but few companies are in a place to use it as the language to deliver an entire web application and even for them I don’t think it’s the right way to do it. I have seen attempts by small and medium size companies to use Go as an entire web application solution and they were disasters.
Golang’s strengths: concurrency, simplicity, robustness (up to a point).
Golang’s weakness: abstraction.
Golang’s sweet spot is web application tooling and infrastructure. Its combination of concurrency primitives and garbage collection work well in a space where C’s low-level access isn’t necessary and C’s requirement for explicit memory management is just an obstacle. There is a whole category of components that Golang can deliver well, safely and faster than could be done with C.
Web applications are not in the sweet spot. Unless the application is very simple.
Go is terrible at abstractions. Rob Pike hates abstractions. Go’s one gesture at abstraction, “interface”, is inherently unsafe. Compared to the abstraction capabilities of any other language in the web application space (and I include PHP in this) it is a joke.
You can write a good, modular, extensible replacement for Apache or Tomcat in Golang. I’d buy that.
Don’t start a business to write a better Facebook/Gmail/Twitter. I’d happily bet against you in the stock market. Even Google isn’t trying to rewrite Gmail the application in Go. But they’ll give it better components. And they’re big enough that if they wanted to rewrite Gmail entirely in Go, it just might work.
When it comes to web applications, choosing the right levels of abstraction - being able to properly separate different levels of abstraction - is important. Go just doesn’t do abstraction.
One example of a disaster I’ve seen where a smaller Web company chose Go as their single solution language. They wanted to write a better webforum application. All the features of existing web forums but more flexible, with customisable rules for subscriber interaction, sub-forums, administration and so on. They raised funding, they recruited. They chose Go.
By the time they ran out of money completely, they had a scalable datastore which could encapsulate the key domain objects. And a web interface that was significantly less useful than phpBB.
Now, which one of those two things represented their business’s intended value add? Which one was an implementation detail they could have bought in? I can tell you that the bit they needed most, te bit they didn’t achieve, is the bit that plays least to Go’s strengths.
Ok, that’s one example so it’s just anecdata. But really, do some research before you make the same mistake.