Skip to content

Instantly share code, notes, and snippets.

@astout
Created October 7, 2018 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astout/488997190fe6272af244851bcccbf3a6 to your computer and use it in GitHub Desktop.
Save astout/488997190fe6272af244851bcccbf3a6 to your computer and use it in GitHub Desktop.
Thinkful Frameworks Response

Frameworks/Libraries

Hi student,

Welcome to one of modern web development's most polarizing debates!

Is React a framework or a library?

According to Facebook, React is a JavaScript library. One way to think of a library is that a library is something that provides an interface to make your top-level design simpler and cleaner. I hope you are familiar with the design concept MVC (Model, View, Controller), if not, I enjoy this simple explanation from the perspective of web development.

Keeping MVC in mind, Angular is considered a framework as it provides the full MVC structure for you. Angular's design is more MV*, Model-View-Whatever, than MVC, but let's just consider it MVC for simplicity. With Angular you define your data models, your view, and the mechanisms for accessing/mutating data.

React provides a library to help structure your application's view (e.g. the frontend/UI). React does not care about your data model nor your controller (the mechanisms for accessing/mutating data), though there are complementary libraries like redux, and react router that can help complete your application's MVC design concept.

Using React vs jQuery

React is a well-defined front-end library that inspires a certain structure to your UI code. React inspires cleaner code design with its component modules. Components present their current state to the UI. If the state changes, react updates the component and the new data is rendered. Cleaner code is often easier to debug and scale. jQuery provides simplified access to the HTML DOM (Document Object Model), but that's it. It doesn't provide much as code design inspiration, which leads most implementations to be highly intermingled JavaScript and html modules which is typically more difficult to debug and scale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment