Re:Loyal Opposition to Const, Private, Freeze, Non-Configura...
by ruethewhirled on Thursday November 03, 2011 @03:22AM
(#3190683)
From your example below: think of one of those ad network scripts (or any other 3rd party script you include on your page) you have no control over what that code is doing. It could override any of your global objects
[ Parent
| on HN ]
Re:Loyal Opposition to Const, Private, Freeze, Non-Configura...
by knieveltech on Sunday November 06, 2011 @12:28AM
(#3201850)
This is accurate regardless of language features. You can't control 3rd party code. Using generic object names greatly increases the odds that at some point you're going to run into a namespace collision and something important will be overwritten. Proper object namespacing your objects vastly decreases the odds of this happening with benign 3rd party scripts, no additional language features required.