5 ms·
Good job. As an alternative view though, one of the nice things about Go, or specifically the http part of the stdlib, is that it composes well with libraries
by kitd 4y ago
Good job.
As an alternative view though, one of the nice things about Go, or specifically the http part of the stdlib, is that it composes well with libraries and middleware like Chi or Negroni. So rather than having to conform to an all-encompassing web framework, you can assemble just the tools you need for the problem at hand.
- cactusplant7374 4y agoSomeone once said, "It's good for simple projects but projects rarely stay simple." That's why I like frameworks and the batteries that they include.
- ilyt 4y agoSometimes you need batteries, not a nuclear plant bigger frameworks come from
- sethammons 4y agoWhat is an example of something simple vs complex? I believe my services' APIs count as simple. HTTP verbs, url and query parameters, some auth headers and jwts, json payloads, and http error codes usually with a json body. As such, all my problems are easily solved with the chi package. I don't do much form handling as our UI handles that and uses our APIs. FWIW, our APIs handle billions of requests per day. What is complex? I imagine things around templating, forms, and maybe (maybe!!) auth. Is that what drives framework advocates? My past experience with a few were that they made simple things simple and hard things harder or impossible. I abandoned them about a decade ago however, so could be out of touch.
- donio 4y agoSimple composable components are especially important for complex projects. The larger the project the less likely that the assumptions made by the framework will be a good fit for it.
- cactusplant7374 4y agoBut that's not important in the beginning and will likely lead to over engineering.
- sgc 4y agoBut that is why I dislike frameworks. Whenever something is no longer simple, it is more work to customize them than it would have been to write something yourself, with judicious use of more specific libraries as opportunistically effective. That seems to present itself rather quickly every time I decide to test out a new framework.