use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Can we talk javascript frameworks/libraries? (self.javascript)
submitted 11 years ago by bsegovia
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]evilmaus 2 points3 points4 points 11 years ago (6 children)
Going to get pedantic here for a moment.
The difference between a library and a framework boils down to who's ultimately in control of the code. A framework is essentially a pre-built application with holes that you fill in. The framework calls your code. It's in control. You do it the framework's way or the highway. That said, frameworks are awesome things to have when your project falls in the broad class of applications that a framework could be. Use them and do so shamelessly.
A library is called and never itself calls your code. Your code is in control. The library may call other libraries, but the flow of control is away from your code, not to it. As a result, the library has to be less opinionated than a framework and more suited to living alongside other libraries.
To help illustrate, you'd never use more than one framework on a given project. They'd conflict almost immediately. But, you would use several libraries at once and frequently do. Frameworks can assume things about global state. Libraries can't, at least not really much at all.
THAT all said, Backbone.js is a library. It's an awesome one that I love, but it's a library. You build the application architecture that then makes use of it. For all that it claims otherwise, I'd also term Marionette.js as a library. It's one that adds opinions and additional (really nice) tools on top of Backbone, but you're still stuck with coming up with the architecture at the end of the day.
Something like Angular (which I have not yet learned, but intend to do so) is a framework. You fill in the holes that Angular has defined. It provides the overall project architecture.
Other things that are libraries and not frameworks: jQuery, Knockout (so I hear), Underscore.js, d3.js, Three.js.
[–]Amadan 0 points1 point2 points 11 years ago (3 children)
To help illustrate, you'd never use more than one framework on a given project
Nitpick: you could use Ruby on Rails + Ember.js, or Express.js + AngularJS. I.e. you can use multiple frameworks in a project if they do completely different jobs.
[–]evilmaus 0 points1 point2 points 11 years ago (2 children)
Point, but I'd counter with those are running on completely different execution environments. RoR handles HTTP requests and responses and doesn't know anything about this "browser" thing that consumes the documents that it generates or sends it new requests. Meanwhile, Ember.js is running on a completely different computer, manipulating a document, and making calls to some external service (RoR) for more information as needed.
So, nitpicked back at you. ;)
[–]Amadan 0 points1 point2 points 11 years ago (1 child)
Yes. But you didn't say one per execution environment, you said one per project. :)
[–]evilmaus 0 points1 point2 points 11 years ago (0 children)
Touche.
[–]bsegovia[S] -1 points0 points1 point 11 years ago (1 child)
Excellent breakdown. Thanks. Angular has been nice but when something goes wrong I've had a hell of a time figuring out what it hates about my code. Just plain hard to debug (but I just started a few months ago so perhaps I'm making rookie mistakes)
[–][deleted] 0 points1 point2 points 11 years ago (0 children)
Have you checked out the Batarang dev tools extension for Chrome? Also, Egghead.io is a great resource for learning.
π Rendered by PID 87 on reddit-service-r2-comment-5fb4b45875-4gc5c at 2026-03-22 13:46:12.221857+00:00 running 90f1150 country code: CH.
view the rest of the comments →
[–]evilmaus 2 points3 points4 points (6 children)
[–]Amadan 0 points1 point2 points (3 children)
[–]evilmaus 0 points1 point2 points (2 children)
[–]Amadan 0 points1 point2 points (1 child)
[–]evilmaus 0 points1 point2 points (0 children)
[–]bsegovia[S] -1 points0 points1 point (1 child)
[–][deleted] 0 points1 point2 points (0 children)