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
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Thoughts? (Score:1)
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 wit
Re:Thoughts? (Score:1)
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
Typesafety (Score:1)
The popular statically typed languages often have difficulty with containers because they have to fit into the static typing scheme. (Of course, if you're using a weakly typed language such as Java or C, you can just cast to the appropriate void and cast back, if you aren't bothered by such things as good taste.)
Thankfully, Perl avoids that route, caring only about the container type, as references fit into scalars.
Re:Typesafety (Score:1)
Pay special attention to 4 [plover.com], 5 [plover.com] and 6 [plover.com].
ObFanBoyStatement: Dominus is so cool. Who else has the courage to point out that those who parade around in Design Patterns for Software are naked?
Re:Typesafety (Score:1)
The GoF book isn't a pattern language, it's just a collection of 'words'.