3 ms·
The problem with this is that either you use a framework or you end up writing one ad hoc using your libraries. Say you use a web server library to help you ha
by Spivak 5y ago
The problem with this is that either you use a framework or you end up writing one ad hoc using your libraries.
Say you use a web server library to help you handle requests on the wire, you’ll probably end up writing something generic where you set up a server, and pass in just the application code to receive the request and return the response which the library will send back.
You just wrote code that surrounds your application code — you made a framework. Then you realize that handling things like logging shouldn’t be in every handler so you invent middleware, you realize that your big ole block of app code is actually lots of small ones in if statements about the path so you factor that out and invent routes, etc. etc.
- wtetzner 5y ago> or you end up writing one ad hoc using your libraries. I hear this argument a lot, but I don't think it really ends up working that way. You build an application with some abstractions, not a framework. The difference is that the code you write does what you need, and doesn't need to support a bunch of different use cases. When you need to change it, you can, without worrying that you're breaking someone else's use of it. And because you only need to support the one application, you can make it as simple as it can be to support that application.