in reply to Hash vs constant vs package vs other for data structure
The first is probably the way I would go. The second is probably mostly useful if performance is a concern; also it would of course mean you don't have to change your data structure. The third OO approach might be useful if your objects not only have properties, but also methods.
The only thing to take into consideration with the first solution is that you don't have automatic protection against typos in property names like you do in the other two solutions. One possible solution is locked hashes, like I showed here, but note also what I mentioned lower down in that same thread (here) in regards to that they might be deprecated someday.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hash vs constant vs package vs other for data structure
by oldtechaa (Beadle) on Mar 27, 2017 at 19:03 UTC | |
by haukex (Archbishop) on Mar 27, 2017 at 19:09 UTC | |
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 | |
by FreeBeerReekingMonk (Deacon) on Mar 27, 2017 at 21:14 UTC |