perlquestion dwm042 <p>I'm running into Moose through Catalyst, and liking what I see of Moose. I've worked in C++ before, with the endless getters and putters, the constructors from hell. For complex classes, the savings in time and clarity gained is worth the code layer.</p> <p>But how complex does it have to be to be a win? Obviously I'm fishing for judgments here based on the experience of the Monks, as I have just my exposure over the past couple weeks of Catalyst hacking. For something as simple as a stack I'm not sure it's a win over</p> <code> my @stack; push @stack, $foo; my $saved_value = pop @stack; </code> <p>That said, in Catalyst, a Moose based model can be preloaded with stuff, from a config file, and it isn't that much harder to do things like</p> <code> my $moose_stack = MyApp::MooseStack->new(); $moose_stack->add_item($foo ); if ( $moose_stack->has_item ) { $saved_value = $moose_stack->pop_item; } </code> <p>My gut feeling though is, the bigger the collection of related data structures in a class, the bigger the potential win. And I'm curious how others feel about this issue.</p> <p>David.</p>