title: Why wrap every prototype "class" object with an anonymous function in JS?
body: <p>Looking at <a href="https://github.com/davidfowl/BombRMan/blob/master/BombRMan/Scripts/assman.js" rel="noreferrer">this JS code</a> by David Fowler he wraps every "class" with an anonymous self executing method where he sends in jQuery and window. I get that this is a way for ensuring that $ and window are actually the global jQuery and winndow variables you'd expect them to be. </p>
  
  <p>But isn't this a bit over-protective? Should you protect yourself from someone else changing the $ and window variable - is there actually code that does that, and if so why? Also, are there <em>other</em> advantages to wrapping everything like this? </p>