3 ms·
Whats the general opinion for using Maps instead of Structs/Simple Objects for the data containers in languages that allow for either?
by nafey 6y ago
Whats the general opinion for using Maps instead of Structs/Simple Objects for the data containers in languages that allow for either?
- aidenn0 6y agoI think for untyped languages like clojure, you lose nothing. For typed languages that don't support parametric polymorphism, you trade type safety for flexibility and code simplicity. For typed languages that support parametric polymorphism, I don't see the advantage.
- yen223 6y agoIf you know ahead of time the shape of the data you're dealing with, you might as well use structs and reap the benefits of type safety and improved performance