@craigfowler - I’ve been aliasing globals for a few years now, and have never run into developer confusion over this (provided that the variables names are easy to figure out, i.e. var doc = document, win = window;). The cognitive overhead of developers adapting to this is trivial, so I wouldn’t worry too much about that.
@Blaise - This is technically not obfuscated code, it’s minified code. Obfuscated code is purposely hard for someone to understand and typically has some level of indirection. In this case, it’s just variable replacement and stripping of white space. The reason I recommend YUI Compressor over Closure Compiler is that the YUI Compressor goes through great pains to make sure that it’s *not* changing your code, it’s only making small optimizations that ultimately add up. I’ve never run into a production problem that was caused by the minification process.
@atk If you’re more comfortable with line breaks remaining, or without variable replacement, there are “options”:http://developer.yahoo.com/yui/compressor/ for those. Also, if you’re really in a pickle and need to debug minified code in production, you can use the technique I described “here”:http://www.yuiblog.com/blog/2008/06/27/fiddler/ .