I've read in Stoyan Stefanov book about single var pattern. Also it's good by JSLint.
But I've noticed in my code that I maybe overload this pattern. It occurs that whole my .js file, whole script is just one big var.
For example:
$(function(){
var
some_var1 = 'some_value',
some_var2 = { /* some other value */},
// more and more vars
tiny_fun = function(){ /* some tiny helper function */ },
tiny_fun2 = function(){ /* another tiny helper function */},
// more tiny functions
Constructor1 = function(){ /* Some Constructor */ },
Constructor2 = function(){ /* Another Constructor */ },
script_body = (function(){
// main script - 'script body'
var c1 = new Constructor1();
c1.some_method();
// and other client code
})(); //: script_body
});
Is it bad? maybe I've misunderstood this single-var pattern and should use it only for variables - to prevent using globals?