title: How do I use backbone.js with namespaces?
body: <p>I have been trying to get namespaces to work with backbone.js for the last hour or so. </p>
  
  <p>I have read: <a href="https://stackoverflow.com/questions/881515/javascript-namespace-declaration">How do I declare a namespace in JavaScript?</a></p>
  
  <p>And I tried all approaches. Here is the problem: </p>
  
  <p>Backbone.Controller wants to be initialized through a constructur ("new keyword"), because otherwise Backbone.history won't be set. This is the code that I'm trying to put into a namespace, for example "Site.Controllers"</p>
  
  <pre><code>var MainController = Backbone.Controller.extend({
  
     routes: {
         "help":                 "help",    // #help
     },
  
     help: function(){}
  });
  
  var ws =  new MainController
  </code></pre>
  
  <p>Whenever I try to put the MainController into some namespace, backbone.js complains that MainController is not a constructor - of course it does, because there doesn't seem to be any way to make a namespace "tree" with constructor functions. If you guys want, I can list all the approaches I tried, but it's exactly the same as from the link provided above. I didn't try putting it into closures, because that is suggested to be very slow.</p>