4 ms·
The term framework itself is kind of hard to define and in many cases almost identical to "library". Is express.js a library or already framework? Or both? At l
by naranha 6y ago
The term framework itself is kind of hard to define and in many cases almost identical to "library". Is express.js a library or already framework? Or both? At least it calls itself a framework..
Many libraries or frameworks do one thing and one thing well, but there are also frameworks that are a collection of libraries for different purposes. I feel entrenched when frameworks limit library choice by making it hard to switch out components. From that perspective I prefer libraries over frameworks, but the distinction is kind of hard to make.
- dnautics 6y agoI think the general rule of thumb (which I don't think the op adheres to): if your code calls it, it's a library, if it calls your code, (as in you are fulfilling some interface) it's a framework.
- naranha 6y ago...which makes the distinction even harder in node, because it is a callback based language. Nearly everything is based on my code being called. Sticking with the example of express.js, for me it feels more like a library since I'm still in control of the program flow, even though I need to adhere to certain interfaces.
- dnautics 6y agoWhy is the distinction harder? Node is a framework.
- undecisive 6y agoYeah. I'd also say if it significantly changes the way you code, it's a framework. So I wouldn't consider jQuery a framework, because you could replace any jQuery call with one or more lines of vanilla javascript. I would call react or backbone.js or angular etc frameworks, because you would have to completely restructure your codebase in most cases - or, at least, create compatible clones of those libraries.
- bckr 6y agoMost helpful comment of the day goes to...!