3 ms·
Frameworks necessarily limit what you can do. For example, the labstack echo framework in Go is one of my favorite frameworks, it does a lot of work for me. On
by zaarn 9y ago
Frameworks necessarily limit what you can do.
For example, the labstack echo framework in Go is one of my favorite frameworks, it does a lot of work for me. On the downside, I can't hijack HTTP connections in the router, like for example, when I want to host something under customs domains and redirect internally to a subURL. I have to hack around the framework to do that, the solution is rather ugly. But there isn't much I can do otherwise that doesn't have various amounts of bugs.
Frameworks will always limit what you can do, period, you will have to code around them once you want to do something they don't allow out of the box.
On the other hand, the less the framework does for you, the less limiting it is but in the same moment it also does less work for you.
- camus2 9y ago> For example, the labstack echo framework in Go is one of my favorite frameworks, it does a lot of work for me. On the downside, I can't hijack HTTP connections in the router, This isn't a problem with "frameworks" but a problem with the library you specifically chose which is bad since it doesn't even fulfill your needs apparently. I wrote my own go http router, and I have no problem hijacking the connection and filter according to hosts, at all.
- zaarn 9y agoWriting a custom http router is kinda contra to the point of using a library, no? I don't want to bother with writing my own router and this was one of the few times I had problems. I think even if I wrote my own framework, I would eventually end up having to hack around it anyway when I inevitably need to do something the framework I wrote just fundamentally can't and I suggest this will be the case for your custom implementation too.
- heavenlyblue 9y agoSo don't evolve your project based on HTTP stack more than an HTTP stack may allow you to. Suddenly, you'd like to have real-time comm? Don't add WebSockets, simply because they fit right above the whole of your stack based on HTTP. Use TCP. There's a very gentle balance between using what you've already got and introducing a set of newer entities into the system; and sadly this is not always that clear, which one you should use.
- zaarn 9y agoYes and that's quite obvious. However, frameworks are stil a limiting fact in code. If I use a framework it won't let me do certain things. Which means I have to hack around or introduce newer entities/dependencies. A balance must be found, in one of the earlier examples, a quick hack was easier.