[Solved] – JavaScript – What is the purpose of backbone.js?

What is the purpose of backbone.js?

Asked on October 20, 2018 in Javascript.
Add Comment


  • 2 Answer(s)

    Backbone.js is basically an uber-light framework that allows you to structure your Javascript code in an MVC (Model, View, Controller) fashion where…

    Model is part of your code that retrieves and populates the data,

    View is the HTML representation of this model (views change as models change, etc.)

    and optional Controller that in this case allows you to save the state of your Javascript application via a hashbang URL

    Some pros that I discovered with Backbone:

    • No more Javascript Spaghetti: code is organized and broken down into semantically meaningful .js files which are later combined using JAMMIT
    • No more jQuery.data(bla, bla): no need to store data in DOM, store data in models instead
    • event binding just works
    • extremely useful Underscore utility library
    • backbone.js code is well documented and a great read. Opened my eyes to a number of JS code techniques.

    Cons:

    • Took me a while to wrap my head around it and figure out how to apply it to my code, but I’m a Javascript newbie.

    Answered on October 20, 2018.
    Add Comment

    Backbone was created by Jeremy Ashkenas who also wrote CoffeeScript.

    As a JavaScript-heavy application, what we now know as Backbone was responsible for structuring the application into a coherent code base.

    Underscore.js, backbone’s only dependency, was also part of the DocumentCloud application.

    Backbone helps developers manage a data model in their client-side web app with as much discipline and structure as you would get in traditional server-side application logic.

    Additional benefits of using Backbone.js

    1. See Backbone as a library, not as a framework
    2. Javascript is now getting organized in a structured way, the (MVVM) Model
    3. Large user community

    Answered on October 20, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.