JQuery and Moose
In the spirt of re-usability, I'm sharing something I posted elsewhere last week:
The context is that recruiters are pressuring older programmers to learn JQuery (read Community College class) and I'm also wondering whether to rewrite a few apps that I maintain.
I'm standing by the conclusion of my Amazon post. Although there is naturally some value to a standardized framework, these frameworks are usually presented in contrast to the worst alternative. The examples demonstrate that JQuery is vastly superior to a procedure based approach that doesn't even use shared function calls for optimization. I reached the conclusion that JQuery provides a handful of generic class definitions for "programmers" who will never learn OO, or other code encapsulation skills.
Granted, Perl5's vocabulary, such as the @ISA idiom for inheritance, should never have persisted beyond Perl5 beta. It seems very tentative, like a placeholder for a task that was never completed.
But I've been thinking about the talk in Austin demonstrating Moose roles and how essential its "partial inheritance" features are. And I started thinking about JQuery. Does this feature simply accomodate poor programming? And as such, is there a danger of institutionalizing poor practices? Nobody should be designing classes that provide functionality beyond the "role" expected in the Moose framework. If an application is capable of multiple roles, each should be split into separate class definitions. Classes are supposed to be specific and discrete.
This post may indicate my ignorance: My CPAN contributions always consist of multiple classes that reflect this programming practice. And it's frustrating that CPAN doesn't distinguish which classes are independent. In other words, CPAN's taxonomy doesn't separate classes from packages. I.e. in Java, a package represents a group of inter-related classes.
Back to Moose: Is the paradigm that what Java considers a package, Moose considers a class; and what Java considers a class, Moose considers a role? I'm sure I'm over-simplifying. But if this description is fundamentally accurate, then I'm inclined to express my reservations, however belatedly. Is Moose merely popular because everyone likes it?