4 ms·
"It's hard to transverse them, or to merge them, or often even to look up a list of keys." That's exactly what I'm arguing against in my comment on making your
by jbooth 13y ago
"It's hard to transverse them, or to merge them, or often even to look up a list of keys."
That's exactly what I'm arguing against in my comment on making your important structs/objects and their relationships explicit. Randomly mutating them together all over your program might seem more flexible but at a cost of making you worry about your code rather than your data definitions. And that's without even getting into performance implications.
If you actually need a Map, of course, that's a different situation than the ones I'm thinking.
- weavejester 13y agoUsing a map doesn't necessarily mean random mutation, or giving up on your type system. In languages with immutable data structures and a sophisticated type system, you can type-check the keys and values in a map.