4 ms·
Set::Object was certainly not around when I was learning Perl. I think this is good thing though. Not learning all these new Perl routines and functions proba
by sdesol 16y ago
Set::Object was certainly not around when I was learning Perl. I think this is good thing though. Not learning all these new Perl routines and functions probably slows down my program. But since we are probably dealing with 5 milliseconds or less, I'm not overly concerned.
I agree that defining the hash the "old fashion way" may be wordy but what I like about wordy things is they are usually easier to understand. Those looking at the wordy code will have one less thing to learn, which will translate into faster learning.
Another thing that I like about wordy is it tends to make porting to other languages a lot easier. For example, one of the tools that I had written in Perl was translated to Javascript with fair ease because I stucked with the basics.
I personally find that being wordy is a good thing instead of a bad thing. Obviously there is a point where not accepting change or wanting to learn a new trick is just being ignorant though.
- jrockway 16y agoI agree that defining the hash the "old fashion way" may be wordy but what I like about wordy things is they are usually easier to understand. Those looking at the wordy code will have one less thing to learn, which will translate into faster learning. I disagree. Using a set to represent a set is more readable than using hash keys to stand in as a set. As it stands, the hash maps values in the set to undef, and maps values outside the set to undef. This is confusing. Confusion translates to slow knowledge uptake. Don't try to jam a square peg into a round hole when you have a round peg in your other hand.