Just started with Elixir book by Dave Thomas.
It talks about two concepts:
Keyword lists
[ name: "Dave", city: "Dallas", likes: "Programming" ]
Maps
states = %{ "AL" => "Alabama", "WI" => "Wisconsin" }
When would you choose one over the other?
There is a chapter in the getting started guide with a quick overview: http://elixir-lang.org/getting-started/maps-and-dicts.html
To sum it up, keyword lists are used for options or when you need to preserve user ordering. For storing actual data, use maps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With