DEV Community

Discussion on: Simple Code Tasks Should Be Simple

Collapse
matthewpersico profile image
Matthew O. Persico

This is why you will hear experienced Perlers (Perlizens?) insist that an array is not a list. If you understand that an array is a list interpreted in numeric indexed order and a hash is a list interpreted in pairwise key value fashion, then you are more likely to perform "list" operations when beneficial. I think the Perl literature needs to do more than it already does to make a "list" a real, live actual data structure, distinct from the array and hash "storage" of lists.

Collapse
manchicken profile image
Michael D. Stemle, Jr. Author

What does this semantic difference mean for those writing code?

Collapse
matthewpersico profile image
Matthew O. Persico • Edited on

It means they realize they can do list-y type things and not resort to loops, i.e. the answer to your followup question is your article. :-)

Thread Thread
matthewpersico profile image
Matthew O. Persico

Or, more precisely, if the semantic difference was more distinctly taught, you wouldn't have had to write your article.

Thread Thread
manchicken profile image
Michael D. Stemle, Jr. Author

Yeah, most dynamic languages seem to have this same difference. I think that for beginners it is semantics, but for those who are starting to come into their own in their coding practice it's a super important concept to understand.

Thanks for this contribution!