News for hackers. Stuff that matters.
Re:Using a Framework will harm the maintenance of your software by flohofwoe on Thursday October 13, 2022 @02:53AM (#33188045)
I don't agree with this simplistic distinction between framework and library. There are plenty of libraries that call back into user code. A better definition might be that a framework imposes an entire 'application model' on you, and trying to step outside that predefined model is at your own risk, while a library is a much smaller and flexible building block (also a building block for frameworks).

But there's a large gray zone between these two, and eventually the distinction is also often quite pointless in the real world.

Re:Using a Framework will harm the maintenance of your software by Someone on Thursday October 13, 2022 @04:06AM (#33188474)
Another, a bit less gray zone, distinction is that you can have only one framework in your program, but can use multiple libraries.
Re:Using a Framework will harm the maintenance of your software by mobiuscog on Thursday October 13, 2022 @06:46AM (#33189395)
In the Java world, at least, you can absolutely have multiple frameworks in your program.
Re:Using a Framework will harm the maintenance of your software by schwartzworld on Thursday October 13, 2022 @09:21AM (#33190600)
You can have multiple programming languages in a program, so of course you can have multiple frameworks.
Re:Using a Framework will harm the maintenance of your software by valenterry on Thursday October 13, 2022 @03:30AM (#33188254)
I think the last sentence is really true. And yes, there are libraries that call back into user code, which makes them framework-like in this regards.

> A better definition might be that a framework imposes an entire 'application model' on you, and trying to step outside that predefined model is at your own risk

This is the kind of definition were 50% will call something a framework and the other half will call it a library then. Not sure if that is really helpful.

Re:Using a Framework will harm the maintenance of your software by 8note on Thursday October 13, 2022 @03:43AM (#33188336)
This kinda suggests that most node modules are in fact frameworks, in that they accept callbacks.

Callback hell however, is not something I'd associate with a framwork

Re:Using a Framework will harm the maintenance of your software by valenterry on Thursday October 13, 2022 @04:09AM (#33188497)
Yeah, if this is not just an once-off async callback (where you could just use a promise) but somthing more complicated, then this is indeed more framework-like and for me would be a reason to try to avoid it.