So this is pretty much where it all started, at least in terms of a formal definition with a simple example. Eric Miraglia explains how and why this pattern is employed in the YUI library and how to namespace your own modules to avoid leaking into the global space causing, or being affected by unintentional side-effects or conflicts.
This post really does start at ground zero with an example that is very easy to follow and digest. The explanation is clear and detailed enough not to leave beginners in the dark. This would be a good place to start if you're just coming across this technique.
This pattern is not without those that disagree with its use. Jonathan Snook talks about why this pattern causes him more friction during his development process than it's worth.
Personally, I can't help but disagree with this assessment given the way I code and find it helps rather than hinders my development process, but his points are worth noting to see if they would affect your work. Understanding some of the potential friction points may help your decision.
If you're looking for something more in depth, this article is not for you, but if you're just trying to explain the concept to a junior who is just starting out, then this will be at just about the right level of complexity.
In this post Jan Van Ryswyck explains why this pattern is useful for packaging scenarios and provides a nice example depicting a package for managing media of a podcasting site.
He goes through the down sides caused by unexpected replacement of functions, how to protect against that, as well as different methods of achieving a clean outcome for your package and the internal methods it relies on to function properly.
This posts leans more towards the experienced developer, but the explanations are so good, that I wouldn't hesitate throwing a junior in the deep end with this one so that they can learn to swim - goodness knows, this article provides some top quality water wings!
For me, the canonical post on this topic comes from Ben Cherry at his blog: Adequately Good. This post pretty much covers everything you need to know about that pattern, including some advanced scenarios that cover Loose and Tight Augmentation, Cross-File Private State, Sub-Modules and Inheritance. A veritable feast of ideas and applications for the pattern.
He also goes into more details around proper unit testing and how to effectively debug code written this way, so be sure to check out his blog if this is your poison.
Hopefully that gives you enough to get on with when learning this pattern. Let me know in the comments if I've missed a particularly good one and I'll be sure to update the post.
Until next time,