Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

what's the difference between framework and library?

what's the difference between framework and library?

2 Answers

With a library you call parts of the library in your code. For example, in Javascript I could call .length(); which is a method in the Javascript library. With a framework it more states the architecture style that you code will follow, for example the MVC framework. Hope this helps :)

For what it's worth, Array#length() is a part of the JavaScript language; there's no such thing as the JavaScript library.

Hey Leandro,

Essentially, a library is just a collection of ready-made and — hopefully — unit-tested methods, functions or objects that you can plug-and-use in your code.

"Framework," on the other hand, encompasses a lot of meanings. Generally, frameworks tend to impose some kind of religion on you, some ritual you must abide by in order for everything to work as intended. In return, frameworks provide a solid foundation upon which you can build skyscraper-sized software. Really though, "framework" is a buzz-word that is often employed to generate hype. "This thing I created, it looks like a library, it quacks like a library but it's actually a framework!" It sounds cooler, I guess.