Data-Stack reviews

cpanratings
 

RSS | Module Info | Add a review of Data-Stack

Data-Stack (0.01)

@Ron Savage
You should read the source code more carefully, it does exactly what is expected from a stack (LIFO) implementation. Internally it's using unshift to to push and shift to pop the stack which might seem counter intuitive depending whether or not you consider index 0 the top or bottom, but regardless that is an internal matter and doesn't deserve your warning and harsh criticism.

--
chansen

Data-Stack (0.01)

It looks like a joke module to me. Everything here is already provided by Perl arrays. I imagine the author knows that? Surely nobody actually uses this.

Data-Stack (0.01) *

To Christian:

I can only draw your attention to
<a href="en.wikipedia.org/wiki/Principle_of_le... Principle of Least Surprise</a>

It's a good guideline on how to avoid bad interface or implementation design.

To Ben:

No, I don't think it's a joke module. You might be thinking of a stack simply using my(@stack), etc.

However, when the stack (arrayref) is an attribute of an object of a class, it becomes a bit painful to be always doing:
my(@stack) = @{$self -> stack};
push @stack, $new_data;
$self -> stack([@stack]);

Vastly better is $self -> stack -> push($new_data).

So, having a rational module, like Queue::Base, to manage something like this, makes sense. Or at least, it ought to make sense.