– What is the difference between a JS Library & a JS Framework?

174 views

– What is the difference between a JS Library & a JS Framework?

In: 1

2 Answers

Anonymous 0 Comments

The question can be revised to omit JS and the answer is still the same.

A library is a package to help you do some works, mostly focused on a business aspect, a function, or a set of use cases. You bring them to your application and plug them in, like add the books to a shelf.

A framework is a set of packages aim to hekp you develop the whole application without needing additional libraries, at the minimum level. It doesn’t concentrate on a business use case, or a predefined function. So you build application on top of it, like an empty shelf.

They both come packaged but you can add libraries to framework or not and still have it going whilst you can’t just do anything with a library alone.

For Javascript, it doesn’t change much except that you can use libraries alone easily as they are all built upon JS. But a framework would lay out an infrastructure that you need to follow in order to achieve the design you prefer while the library might be depend on the framework to be utilised fully.

Anonymous 0 Comments

You’re building a bookshelf.

The library would be your tools, your hammer and saw – you can make the bookshelf any way you want – but its a lot more work because you’re starting with just tools.

The framework would be an already assembled bookshelf, you can change how many shelves, the gap between shelves, and you can change the color – but thats all. Its quick and a lot easier, but you have to be okay with some parts the framework decided for you.