I think a good complement tothis concept is that of "this"-less Javascript, relegating it only to things like mixins.
So many headaches are to be had if you're not careful and using some decent functional things.
So many headaches are to be had if you're not careful and using some decent functional things.
Absolutely. My preference for new modules is to use both newless and "this"-less Javascript. Newless via the technique outlined in this post (or encapsulated in a module: https://github.com/Mr0grog/newless), and this-less via the module pattern (see link in post).
This is the pattern followed by D3. It's easy to follow internally, gives you true private data and methods, and (IMHO) is a nicer interface for API consumers -- no `new`, `delete`, or `bind`'s necessary.