in reply to Re^12: Data Structures
in thread Data Structures
Your argument against Sub::Exporter does not make sense to me, it seems as if you are saying that I should only provide as much features as my user base uses and that the extra bits inside Sub::Exporter that I am not using are slowing me down. To start with Moose is not a simple one-size-fits-all module, some people use it as a simple accessor generator and base.pm replacement, but others use it as a full fledged metaprogramming system and hit on edge cases I never even imagined to exist. Now, very few people have taken advantage of the extra bits that Sub::Exporter adds, basically anyone who has done what is described in the "EXTENDING AND EMBEDDING MOOSE" section of the Moose POD. However, that said I do not think that providing a broken (Exporter) or minimal (hand-coded to the exact spec) would be a superior solution, it would only mean then when people wanted/needed those extra features I would have to add them or say "no sorry I used Exporter and it sucks to bad" or "Well it will take me a while to add that to my hand-coded solution". Sure you can make an argument for speed, but not all of us are as speed obsessed as you seem to be. Perl is getting faster (the Moose and Class::MOP test suites both run noticably faster in 5.10) and computers in general are getting faster (the argument that Moores law has a ceiling really doesnt apply to this specifically so lets not go there). You can also make an argument for "extra dependencies", but honestly I dont see the problem with dependencies. If we were coding Python and this was 3-4 years ago and there was no decent module repository and dependency management tool, or better yet, if we were coding Java today,.. then I could understand that argument. But we have CPAN, and despite the number of problems it has, the benefits of it far outweigh them. There is (IMO of course) absolutely no excuse for not using the CPAN as much as possible. This is not to say that people shouldnt re-invent wheels, I think that is an excellent way to learn and grow as a programmer, and if you wheel is better then please upload it. But anyway, I digress, and honestly I think we will have to agree to disagree on many of these points.
It's minimal, just enough to meet the requirements of the challenge, but I hope it is enough to show that much of what Moose does, could be met without large dependency chains, and rather more efficiently. (Especially once you drop the need for bondage and discipline!)
Hmm, not really, not really at all. Where is the MOP? Method modifiers? Roles? And what about types? You call it B&D, but really its much more about sanity checking, if you have only ever used the strong type systems of Java/C++/C#/Ada then I would understand your dislike, but if you explored the more superior type systems that are offered in ML/Haskell/OCaml, then you would feel differently I suspect. Again, seems here that you are advocating only providing as many features as you need for a given usage. This may create efficient code with minimal dependencies, but this does not promote generic re-usable solutions. Sure, this can be your choice in the trade-off, but it is not mine.
Hmm,.. I am almost starting to think you have a background in embedded systems or something, given this obsession with efficient code that can run in a small space with few dependencies.
I guess that sums up my feelings about a lot of this kind of module. (Sub::Exporter et al.) At their core, they provide a single, useful mechanism. But then, almost inevitably, they feel the need to add to that basic mechanism a bunch of "fun tricks", which whilst fun, often aren't required by most of their users
I disagree completely on this with regard to Sub::Exporter, every feature that it provides is useful and well thought out. I know for a fact that RJBS uses a good portion of them in his $work code too, they are not just "fun tricks". I suggest you give this set of slides a look, he goes over a lot of what Sub::Exporter can do and where it is useful.
Again, it seems your only looking at the surface features and what the top layer provides and not digging deeper to see the possibilities. I believe that modules like Sub::Exporter and Moose are "disruptive" modules, meaning they force you to stop and rethink previously held assumptions and ways of doing things. Just as Moose is helping to rid the Perl world of hackish DIY-OO programming, so too could Sub::Exporter be used to fix some really ugly and horrid code in some other modules (I wish I had the time to show an example of this, perhaps I will at some point).
If you are really up for a challenge?
No thanks, the code looks like a mess and I am not really in the mood to detangle that. If you want to clean it up and port it to Moose I will be glad to work with you in making sure it is as Moosey as it can possibly be.
But the results would make for a very good demonstration of the power of Moose.
I totally disagree, this is a performance intensive application, and Moose has well known performance issues. If I didn't know better I would think you were stacking the deck against Moose here ;)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^14: Data Structures
by BrowserUk (Patriarch) on May 23, 2008 at 23:07 UTC | |
by stvn (Monsignor) on May 24, 2008 at 04:28 UTC | |
by BrowserUk (Patriarch) on May 24, 2008 at 06:15 UTC |