by pphysch · 4y ago · 0 comments
Yes, Go has nice standard templating and HTTP serving libraries, and nice dependency management. These are all important features for a web framework.
No, it will never be productive as its competitors in the web framework space, because you simply cannot write expressions like `order.customer.region` that intelligently hit the database, because you can't override the dot operator. Instead you have to write unreadable crap like `regionController.Show(userController.Show(order.customer).region)` which is infinitely less "productive" than the former, for obvious reasons. Oh, you can `go generate` the *.Show definitions from a simple struct definition (or with 1.18 generics)? Too bad the final product is still unusable!
Use Go where it excels and connect it to your Ruby/Python/Typescript web backend over gRPC or HTTPS.
Writing backend with a rigid, verbose, mostly type-safe ORM: $5
Writing backend with a terse, expressive ORM: $2.50
Adding type annotations to the previous code: $1
So for authoring an app, I tend to agree with you. Languages like Ruby/Python/Typescript are probably faster to get something working.
I try to consider productivity holistically though. With Go, there's a lot less fussing with the tooling. I've also found Go saves a lot of time when onboarding new teammates. This is because of Go's intentional decision to be conservative with syntax. After all, most developer time is spent reading, not writing.
I respectfully disagree with your preference to split your backend up over gRPC or HTTPS. I prefer the approach Shopify takes to break up it's monolith: https://shopify.engineering/deconstructing-monolith-designin...
Bud will support something like this in the future.
Ultimately you will be teaching the framework, not the language, when it comes to large frameworks like this. Both Go and Python are easy to learn, but frameworks always add a lot of complexity.
> I respectfully disagree with your preference to split your backend up over gRPC or HTTPS. I prefer the approach Shopify takes to break up it's monolith:
I'm not arguing for this or that architecture cargo cult. I prefer monoliths too, but sometimes you really need distributed microservices and Go+gRPC is one of the most maintainable ways to do that.