-
Namespacing techniques and the {} wrapper
I’ve noticed that ExtendScript experts seem to agree that the best way to keep the namespace clean in extendscript is to wrap everything in curly braces
{ //expression; }. This doesn’t make sense to me though, because in Javascript, local variable scope only happens within a function object. So shouldn’t the wrapper instead be(function(){ //expression; }())? I’ve actually tried the curly braces technique and it hasn’t worked for me so I’m just wondering if there’s something I’m missing or if I should be announcing to the world to stop using curly braces wrappers and to start wrapping with a self invoking function as mentioned above.