in reply to Re^2: Hash vs constant vs package vs other for data structure
in thread Hash vs constant vs package vs other for data structure
What are the advantages of the hash method?
Two that I can think of off the top of my head are that you can have sparse property sets (e.g. if one object has {foo=>1,bar=>2} and the other has {quz=>1,baz=>2}, whereas you'd need four array elements to cover that, a bit of a waste), and that textual serializations of the data would be self-documenting. But if neither of those are a concern to you, then at the moment I can't think of major disadvantages to using constants for the array indicies.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Hash vs constant vs package vs other for data structure
by oldtechaa (Beadle) on Mar 27, 2017 at 19:46 UTC | |
by Anonymous Monk on Mar 27, 2017 at 20:10 UTC | |
by Anonymous Monk on Mar 27, 2017 at 20:24 UTC | |
by oldtechaa (Beadle) on Mar 27, 2017 at 20:31 UTC | |
by BillKSmith (Monsignor) on Mar 27, 2017 at 21:54 UTC |