This is a sociological problem.<p>The further up the abstraction hierarchy you customize things in languages that let you do this, the more differentiated your code is and - generally speaking - the more awkward it is to integrate with other people's code.<p>Lisp and Smalltalk are at one extreme end of the scale here. They let you define rich DSLs. Unfortunately, application of their most powerful features to any given problem domain typically results in a custom language specific to that domain - so much so that you lose much of the benefits of sharing a language with other programmers. Understanding what's going on takes much more work, because you need to understand more of the system before its gestalt becomes clear.<p>DSLs are excellent when they're applied to problem domains that are otherwise very clumsy to express, when the problem is widespread, when it doesn't intermix too deeply with other domains (i.e. the abstraction is mostly self-contained), and when there is a critical mass of programmers using it - enough that understanding the system at its own level of abstraction is enough for most people.<p>But when you apply the same techniques to relatively humdrum problems like object construction, function binding etc., it's best if the language or its standard library has a reasonable approach and everybody uses it. Developing your own ad-hoc language around class construction means that everyone coming into your code needs to understand it before they can truly understand what the code is doing. It's a barrier to understanding, and the pros of customization need to be substantially higher than the costs of subtlety.<p>In short, it's usually better to be explicit.
Joose[1] took these patterns about as far as anyone has (open source) as of several years ago; it's based on Moose[2] for Perl.<p>When Bill Edney and Scott Shattuck finally release TIBET[3] upon the world (something like 15 years in the making), it will take "real OOP" for JavaScript to a whole new level. TIBET is basically a full-on Smalltalk system (including a kernel, images, modules) for JavaScript, but it's not a compile-to-JS kit; rather, it builds right on top of the language, kind of a "super library" for ultra heavy-duty browser based apps.<p>[1] <a href="https://github.com/Joose/Joose" rel="nofollow">https://github.com/Joose/Joose</a><p>[2] <a href="http://search.cpan.org/~ether/Moose-2.1204/lib/Moose.pm" rel="nofollow">http://search.cpan.org/~ether/Moose-2.1204/lib/Moose.pm</a><p>[3] <a href="http://technicalpursuit.com/" rel="nofollow">http://technicalpursuit.com/</a>
<i>But if we do buy the proposition that OO is a good idea for our domain, shouldn’t we ask ourselves why we aren’t using it for our classes?</i><p>"If X is a good thing, why aren't we using more X?" No. I've seen horribly convoluted and overly complex code written as a result of following this sort of dogma with things like design patterns. OOP can be incredibly useful when applied correctly, but don't think that it's a panacea or that "OOP-ness" is somehow directly correlated with code quality. Layers of abstraction and encapsulation are very good at hiding bugs too, and IMHO they're overrated.
<i>The basic proposition of OO is that objects encapsulate their private state.</i><p>I'd say the most basic proposition is that you solve problems by representing the nouns in the problem domain as objects in software. You could have a version of OOP that doesn't involve hiding internal state.
I generally prefer to KISS than to OOPOOP, but if you are building a large, sophisticated framework for large, long-term projects with large, stable teams, then yeah, it is a good idea to turn your patterns and structural standards into semi-custom languages within the language.
I prefer to keep things simple.<p><a href="https://gist.github.com/rahulkmr/9482010" rel="nofollow">https://gist.github.com/rahulkmr/9482010</a><p>It makes working with teams easier.