4 ms·
A resolution for your confusion is that this is a result of Go being younger than the web. Languages turn over very slowly and most languages used on the web fo
by jerf 4y ago
A resolution for your confusion is that this is a result of Go being younger than the web. Languages turn over very slowly and most languages used on the web for the server are older than the web, or at the very least, older than the web being a major concern for them. Many "web frameworks" are, at their core, a way of hooking many different things together. Go's net/http is already that framework, so it is practical in Go to not have "a framework" tying everything together. You can take a router from here and a variable mapper from there and a template library from yet another place and they all already have the foundation to work together. Some of those places may even be from full "frameworks" of their own, and things still tend to work together pretty well.
I emphasize the age of Go because I don't think this is a virtue of the language per se (considered as a bag of features), or because the developers were super geniuses who could see what nobody else could. It's just that net/http was able to be spec'd and put into the standard library based on the decades of experiences other languages had. I would expect any other upcoming languages to be able to pull off a similar trick, as long as they try.
I certainly don't sit down with every Go web app I write with literally nothing but the standard library. I do have some non-trivial code written that way, but it isn't something I seek out as a terminal goal. It just isn't necessary to go commit to "Spring" or "Ruby on Rails" or some other framework just to get access to anything at all. I'm already in the Go ecosystem just by using net/http, you're not obligated to commit to a "framework"'s ecosystem just to get access to basic functionality because you're all but already tied in to a framework's ecosystem just by using Go, and there are many options for that basic functionality.
And to be clear, I'm more agreeing with you than disagreeing with you; I'm trying to explain the divergence between your understanding and what the Go ecosystem has because I consider it a worthy question to ask, and there is legitimately an interesting question to consider here based on experience from many other languages.
- asim 4y agoI like the rationale here, had not really even considered the era in which Go was created and the implications for that in comparison to languages and frameworks of the past. You're right though, it changes things. My experiences from ruby and java were just that frameworks ended up creating standardisation and Go being the language of the Cloud was probably going to need something similar. Adoption curves take time but I think you're right, it's more likely that an extension to the standard library for distributed systems concerns works better than say a framework.
- vlunkr 4y agoBetween net/http, database/sql, and html/template, you can make an MVC app. I agree with you that doing so isn't necessarily a worthy goal, but it provides a standard for all web frameworks/libraries to start with, and makes them more likely to get along.