3 ms·
The addition of maps is really awesome. In my applications I've had records, which are kind of like C structs, being passed around to represent state. But if I
by mediocregopher 13y ago
The addition of maps is really awesome. In my applications I've had records, which are kind of like C structs, being passed around to represent state. But if I need to add features the records become very constraining, because adding another key to them invalidates any previously existing records when you do a hot reload. So you have to jump through a bunch of hoops to get the records migrated, or just restart the whole system, which is less than ideal.
With maps this whole class of problems goes away.
- njharman 13y ago>With maps this whole class of problems goes away. A friendly warning from long time dictionary (ab)user. They introduce their own class of problems. Basically the strong vs weak type ones.
- mediocregopher 13y agoAgreed. Erlang's maps have two different operators when setting values on them, one if you care that the key already existed and one if you don't, so in that way you can still somewhat enforce strictness of keys. But you can relax that strictness when it comes time to roll out changes.