3 ms·
Fewer abstractions really help with APIs. Go gets out of the way more, and for APIs that really makes a difference. An example might be handling the Accept hea
by buro9 9y ago
Fewer abstractions really help with APIs. Go gets out of the way more, and for APIs that really makes a difference.
An example might be handling the Accept header to give back multiple formats... many frameworks try and hide this from you, and so you have to fight to get something done. But Go exposes everything in a consistent and intuitive way, and there are mature packages for all of this stuff so it becomes trivially easy to work with.
JSON work is simple, CSV work is simple, XML work is fairly easy, image work is simple. It's pretty beautiful as language/std package experiences go.
It would need a more intuitive templating workflow for web stuff though (the "page.html inherits base.html and includes []block_*.html" story is a bit janky), and I've not yet found a decent answer for the l10n and i18n stuff, and whilst Hugo has a great template funcs library they've purposefully entangled it with their code, and so there is a lack of a core template func package to deliver a lot of things along the lines of Django templates.
So Go is great for APIs, but weak for web.
- drudru11 9y agoThx Buro9