5 ms·
I think OP has made a mistake calling it a framework as it is not a framework, it is a library. People have added more libraries to it. On the contrary, yes Ang
by specialp 10y ago
I think OP has made a mistake calling it a framework as it is not a framework, it is a library. People have added more libraries to it. On the contrary, yes Angular is a bonafide kitchen sink framework missing the major advantage of a framework: A STABLE somewhat opinionated stack. You are correct though that making React into a "framework" is a hot mess.
- stupidcar 10y agoWhile React is certainly more lightweight in many respects that something like Angular or Ember, I still think it qualifies as a framework. For me, the primary difference between a library and a framework is the the typical direction of instantiation and calls between your own code and that of the library/framework, and the ownership of the main workflow / event loop. E.g. does it feel like your code uses the 3rd party code, or that the 3rd party code uses yours? Putting it more concretely, when you code is executed, does the 3rd party code tend to come after it in the stack, or before it? With a library, you're mostly calling its methods. So, a library is something like jQuery, where you're just making a lot of calls to its methods. Those libraries might do some very complicated things, but they're still just operations that you have launched, and which eventually return control to your code. With a framework, you're inheriting from framework classes, and conforming to a workflow that the framework controls. For me, that describes React. You write in its JS dialect (jsx), your classes inherit from React.Component, and you hand over control of the rendering workflow to ReactDOM.Render and the virtual DOM.
- wccrawford 10y agoI agree. React is far too opinionated for me to treat it as just a library. I use it as a framework just as I would use Angular, and it fits the bill. That it can also be used as just a library is a bonus, but doesn't define its identity.