Bent On Coding

Immediately-Invoked Function Expression (IIFE)

The Immediately Invoked Function Expression (pronounced iify) is an excellent way to write modular namespaces in javascript.  This pattern is sometimes also know as  a Self Executing Anonymous Function, but that is not the terminology I will use here because it is slightly misleading since the function does not actually execute itself.

No matter what the documentation says, the source code is the ultimate truth, the best and most definitive and up-to-date documentation you’re likely to find.

-Jeff Atwood @CodingHorror

It’s very common for a new javascript developer  to throw every bit of javascript code they write into a few very large Javascript files (2000+ lines of code). It’s not uncommon for a single Javascript file to be 2000+ lines of code. I cry a little inside every time I have to open a javascript file like this. It’s painful to read and navigate, and personally…

View original post 628 more words