Framework Vs Library

Framework Vs Library
0

#1

Bootstrap is a front-end framework.

JQuery is a library.

Node.js is a cross-platform JavaScript run-time environment.

Now, the question is what is a framework? what is a library? what is a run-time environment?

And the main question is what is the difference b/w framework and libaray?


#2

library, just like a real library, has resources (functions for eg) that you can use as you see fit. It doesn’t force you to use anything.

framework, unlike a library, forces you to fit into it. (You have to go out of your way to not fit). Imagine a framework for a building. It forces the builders to build within it. The building will be what the framework says it should be.

I’ll let someone more experienced in Node.js respond to the part about RTE.


#3

How come bootstrap is a framework and jquery is a library?
From what i understand i think both are libraries.

We include both of them in our project/file. The come to us.
Django is a framework. We go to them.


#4

Come to us = frontend. we go to them = backend but both can be frameworks. But as @hbar1st pointed out a library is just a resource you may use for your own needs by just using specific functionalities. Instead a framework imposes you to follow a certain development pattern.


#5

This post on StackOverflow should help clear up the topic for you (you should read the whole page, not just the first answer): https://stackoverflow.com/questions/148747/what-is-the-difference-between-a-framework-and-a-library

I’ll answer this question on two levels:
(1) The designer/implementer of a framework or library did it that way for their own reason which is known only to them.
(2) Bootstrap is a CSS framework because once you adopt it, it changes the way you approach and write your CSS code. jQuery, on the other hand, doesn’t change the way you approach and write your JS code. It simplifies things, but it doesn’t change your fundamental approach. A true JavaScript framework is something like Angular—your whole approach to the front-end is entirely based on it, and you pretty much fill out only the specific areas that need customization.

Run-time environments are a little trickier to explain and this will gloss over a lot of details, but:

  1. You write the source code of a program using a programming language
  2. In compiled languages (C and C++), the source code is converted to an executable file that runs directly on the host computer
  3. Alternately, in interpreted languages (Python, JavaScript, Ruby), the source code is converted to an intermediate form that runs in the interpreter (which is a program that runs directly on a host computer)
  4. The interpreter can be thought of as a “run-time environment” because it’s the environment that runs the code that you wrote

For Python, the usual run-time environment is the Python IDLE, and other languages have their own (like the REPL for Ruby). JavaScript’s RTEs are either in the browser (any Web browser) or Node.js, an environment outside the browser.


#6

At some point you need to run the code you write, and that code needs to make physical things happen within the computer it is executing on. A runtime environment is somewhere that can allow that to occur. So your JavaScript code, when executed in the Node environment, can communicate with the computer system that version of Node is built for.