Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • by pdcawley (485) on 2003.09.08 11:45 (#24011) Homepage Journal
    You're wrong.

    Using specific container classes helps you to document behaviour. It should help you put appropriate behaviour in the right place and move shared behaviour into superclasses.

    Ask James Duncan about the trials of dealing with a mature application that is mostly OO but with a largish datastructure that was initially implemented with anonymous hashes and arrays. The up front laziness cost them time and time again as they came to extend the system and they all sorts of fun trying to replace it with a real object later on because they couldn't quite be sure if they'd found every site that violated encapsulation...
    • pdcawley does echo my thoughts on this. In large systems often you don't want to just be push'ing on or pop'ing from an array. You want to be doing things like validation of values that are being push'ed and pop'd.

      If you want to be doing validation then you want to ensure that you Don't Repeat Yourself. You also want to make sure that the behaviour is close to the data. In short, you want a class.

      For sure, with Perl, you could tie the Array or Hash, but, there is a problem with that. First, Tie'ing