I cam upon this code in an example for the EaselJS library - what it does is it assigns the namespace of the entire createjs library to "window".
<script>
var createjs = window;
</script>
My question is this: Is setting the namespace of a library to window a really dumb idea? Doesn't it just get rid of the whole point of using a namespace by making all the namespaced variable suddenly global scoped?
The only advantage I can see is letting you write shorter contructors for your objects. For example typing:
stage = new Stage(canvas);
instead of:
stage = new createjs.Stage(canvas);
Is this a bad idea, or is is somehow brilliant, or just harmlessly quirky?