April 3, 2011
The problem is, I don't like it. My main issue with this pattern is readability: it makes it easy to fall into the trap of confusing which functions are private vs. public. This is especially true when you come across code that alternates private and public functions haphazardly like this:
Yes, I know that you can just scroll down to the "return" statement to see which functions are public, but I find that having the public function definitions in the "return" block more intuitive when reading code. The whole point of private functions is to provide abstraction.
When using the regular Module Pattern I can read the public function and scroll up to the private definitions if needed. When reading the module from the top I don't need to keep a mental model to track which functions are public vs. private.