Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7430553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:09:35+00:00 2026-05-29T09:09:35+00:00

I am using _.bindAll in lots of my Backbone.Views. _.bindAll(this, ‘render’, ‘addOne’, ‘addAll’, ‘someFunctionA’,

  • 0

I am using _.bindAll in lots of my Backbone.Views.

_.bindAll(this, 'render', 'addOne', 'addAll', 'someFunctionA', 'someFunctionB');

While refactoring this becomes quite tedious as I need to keep the views methods and the name listings in sync. Both ways this often leads to simple errors.

As there is a short version of bindAll, which would eliminate this need, I am wondering what drawbacks (performance, readability, flexibility, ..) do exist and do you consider them acceptable to gain a bit of a productivity boost.

_.bindAll(this);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:09:36+00:00Added an answer on May 29, 2026 at 9:09 am

    There is no practical performance penalty for using that form of bindAll. However, it will be a pain if you do not want a method bound to this for some reason.

    However, you may find that you do not need to use bindAll as often as you think. All methods that are bound to event handlers (with the events hash) are automatically bound to this.

    Also, when you are explicitly binding an event, you can pass the this binding in the third param. For example:

    this.model.bind('change', this.render, this)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get my head around backbone.js. This example is using Backbone Boilerplate and
Using backbone.js, here is a quick test to demonstrate the problem I am facing
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
using file_get_contents , I open an Internet URL and get the contents of this
I have the following code: initialize: function() { _.bindAll(this); var callBack = function(res) {
I am working on my first project using backbone.js. It should be a frontend
I'm using Backbone.js and Phil Sturgeon's CI rest server (AMAZING TOOL, definitely recommended). Here
I am currently using Backbone.js collection and View and I am attempting to bind
I'm trying to display a list of projects using backbone.js. Basically, backbone should be
Im using backbone.js to get a collection from the REST server. Fetch triggers fine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.