

How to structure your JavaScript code - qhoxie
http://peter.michaux.ca/article/9081

======
cdr
This is pure blogspam; the real link is <http://peter.michaux.ca/article/9081>

------
pmjordan
Nothing vastly new here (especially if you've watched Douglas Crockford's
videos) although I must admit I quite like the local

    
    
      var global = this;
    

concept for when you're creating more than one element in the global
namespace/object. The reason you wouldn't use window is of course that your
code will port to non-browser platforms, and you don't use unqualified names
because they look like a mistake (e.g. you left the 'var' off)

------
DanHulton
Man, I'll have to write up how _I_ structure javascript at some point. I
prefer using objects for namespaces, while he's got good points about why
those can cause problems, there's well-known workarounds for what he points
out.

