stevan / promises-perl

An implementation of Promises in Perl
31 stars 29 forks source link

Moo-sify ALL THE THINGS #44

Open yanick opened 8 years ago

yanick commented 8 years ago

To be fair, I am not sure if this a wonderful idea or an exercise in yak shaving. In any case, here it is for your potential pleasure. The tests are passing for me, and they don't take much more time from the original raw-object code; time went from 5 seconds to 6, and to 11 if I change Moo for Moose. :-(

stevan commented 8 years ago

Question, does this scratch any particular itch for you? Because to be honest, I don't think that Moo(se)ifying this code provides any real benefits. I am always open to discussion though.

yanick commented 8 years ago

No real itch, beyond "oooh, it would look 0.67% cleaner if the class stuff was Moobstracted". And I totally agree that for code of that size, that's probably compulsive shaving more than anything else. So, yeah. you are totally justified to go "thanks but, yeeeeah, no thanks". I just had to do it, the voices didn't give me any other choice. :-)

yanick commented 8 years ago

Actually, all that stuff can actually be useful for one thing: the new Promises::Role::Promise role can be used to represent a generic promise interface. If it was around, I could write a Future::AsPromise interface and have code that can accept either implementation by only caring about ->DOES('Promises::Role::Promise').

hmmm, but then Promises::Role::Promise should probably be on a distro of its own (Role::Promise) so that it can be used by either Future or Promises without the need to install both.

... sorry, my mad scientist button is kinda stuck this week. I'll be silent, now, I swear. ;-)

stevan commented 8 years ago

Promises::Role::Promise was my favorite part actually, so I am happy to hear you will preserve it