in reply to Wanted: Spiffy evangelist

Maybe the fact that nobody has voted on Spiffy yet could be a warning sign?

To me, Spiffy is yet another way of being too clever for your own good. It is Ingys object framework, and it is mainly used for Spoon, which in turn is a nice thing for very small, very contained scripts and nothing else. I am wary of using modules that contain way too much magic, and if I were to build a bigger framework, I wouldn't rely on anything that requires a larger span of attention from Ingys part.

To address the problem you want to solve, why not just use the following code (which I use all the time):

package My::Class; use base 'Class::Accessor'; __PACKAGE__->mk_accessors( qw( foo bar baz )); sub new { my ($package,%args) = @_; my $self = { # Set some defaults foo => 'The foo', bar => 'The bar', baz => 'The baz', %args }; bless $self, $package; $self; };

That way, you don't have to pass in hashrefs to your constructor.

Replies are listed 'Best First'.
Re^2: Wanted: Spiffy evangelist
by Joost (Canon) on Aug 16, 2004 at 11:36 UTC
    Maybe the fact that nobody has voted on Spiffy yet could be a warning sign?

    It could also be a sign that the module is relatively new, and/or that people don't vote much anyway (Class::Accessor has 1 vote, for instance)

    To me, Spiffy is yet another way of being too clever for your own good

    I must confess I feel slightly uneasy about a module that uses Exporter, OO and source filters at the same time, but OTOH it's trying to solve a couple of fairly basic (as in "hard to solve") issues with the perl OO mechanism. Whether these issues need solving is ofcourse debateble.

    If cleverness alone would be a problem, people wouldn't use Class::DBI::Loader either. It all depends on the problem you're trying to solve. If you want full control and performance, you use DBI directly. If you want to quickly write some code to edit a couple of tables in a database and performance isn't your primary concern, Class::DBI::Loader might be perfect for you.

    I wouldn't use Spiffy for anything large at the moment (it looks almost impossible to remove after you've put it in your code, which can be a big problem if it doesn't work as well as you expected), but using it in a smaller project should be interesting, and might also give more insight into Spiffy's (dis)advantages. I'd welcome a couple of reviews :-)

    updated: punctuation.

Re^2: Wanted: Spiffy evangelist
by ysth (Canon) on Aug 16, 2004 at 09:33 UTC
    Last I checked, the development version of YAML on CPAN also depended on Spiffy. Kinda scary.
Re^2: Wanted: Spiffy evangelist
by itub (Priest) on Aug 16, 2004 at 15:49 UTC
    Spiffy is also used by IO::All. I have used it because I worked on IO::All::LWP, and I'm happy so far, but I really don't know enough about it to consider myself an evangelist.
      WOW, ingy, author of Spiffy, is using Spiffy in modules he is writing/maintaining? You don't say /sarcasm