I have been playing around with Backbone on and off for a month or two now, but I just can’t seem to like it! The image below is from a project I just come aboard on and I think it clearly shows the problem with Backbone.js.

Backbone.js parameter problem

12 Parameters, come on! Backbone.js is just too generic, it is not a Web framework. Too much boiler plate code has to be written, too many “standard” features are not included and have to be manually included as 3rd party dependencies. I mean, in 2013, why, o why does Backbone not ship with a full suite of tests and a starter / seed app?? I spend more time trying to get stuff working in Backbone.js (and reading out-of-date documentation) than I do actually writing Backbone code!

Maybe someone will fork Backbone.js and include a full Web centric stack, provide proper documentation and working examples (that actually work with the current version!!), I can hope at least.


4 Comments » for Everything that is wrong with Backbone.js, in 1 image
  1. David Ron says:

    That looks like an AMD-style module definition. Each of those parameters is a dependency, and there are supposedly no other dependencies (global variables) that the module has access to. This is typical for an AMD module definition, and it is synonymous to the import statements at the top of any language that supports namespaces. I don’t think anybody could argue that a module that imports only 12 dependencies is bad.

    Due to the way AMD works, it’s not currently possible to group those imports into objects, unless you wanted to pass in a single object named “dependencies” and then set up the vars at the top of the module to extract all of those variables from that object. Such as refactoring would actually increase the amount of code without any real improvement from what I can tell.

  2. David Ron says:

    Oh, require.js actually DOES have a way to reduce the number of parameters to the module definition, but again, when there are 12 dependencies, I’m not sure if it’s worth the added complexity of implementing this style in backbone:
    http://requirejs.org/docs/whyamd.html#sugar

    • Robert says:

      The biggest compliant about Backbone is that I have to do so much work to get something useful. The fact that backbone can work both on the server side (node.js) and in the browser/front end is a real negative for me. If I can paraphrase, a Framework should do one thing and do it well. No doubt there are use cases where Backbone is awesome, but I just don’t think those uses cases happen in very front-end heavy projects. I’d be very interested in reading about any successful web apps that use Backbone. I’m starting to look into AngularJS and it seems to have some great features (such as a seed app with a full working test suite)

    • Joshua Farrar says:

      You can make those dependencies at least look more reasonable:

      define(function(require) {

      var Chaplin = require(‘chaplin’),
      People = require(‘models/people’),
      View = require(‘views/base/view’);

      var PeopleView = View.extend({

      });

      return PeopleView;
      });

Leave a Reply

Your email address will not be published. Required fields are marked *

*