List-Objects-WithUtils reviews

cpanratings
 

RSS | Module Info | Add a review of List-Objects-WithUtils

List-Objects-WithUtils (2.010002) *****

I agree with educated_foo that doing $list->push(@items) is no win over push(@$list, @items). However, that's not where List::Objects::WithUtils objects shine.

What they are useful for (and this is something the documentation could better emphasise) is use as attribute values (or in Java terminology "members") in object-oriented programming. $widget->valves->push(@more) feels nicer than push @{ $widget->valves }, @more. And thanks to Moose/Mouse/Moo's method delegation features, can easily become just $widget->push_valves(@more) which is nicer still. (q.v. Law of Demeter.)

List-Objects-WithUtils (2.003001)

While I understand educated_foo hates anything that smells like an object, and I get that "arrow-infested" syntax like `$hash->sliced('foo', 'bar', 'baz')` is less readable to some folks than writing a classic hash slice with an exists() check (for example), I think that his "send it to Acme!" review is a mischaracterization of what my module does.

Core operators are present -- they also live alongside other bundled tools and toys for working with collections (List::Util, List::MoreUtils, List::UtilsBy, junction objects, etc) packaged in a way that encourages thinking in functional terms.

Most methods that manipulate a list return new objects; avoiding mutable lists is easy/encouraged (or enforced via immutable objects).

Version 2 also adds type-checking objects (mutable and immutable) via integration with Type::Tiny.

I have simplified a fair bit of my in-house code this way -- at the (admittedly relatively heavy) cost of method call overhead -- which is why it is on CPAN ;-)
1 hidden unhelpful review