I've been learning the basics of Elixir for the past few days, and while I have read more than once that novices have a hard time deciding which data structures to use, I personally haven't seen anything much different between Maps and Structs. By this I mean:
- To access fields on a Map, I always need to call
Map.fetch(@map, :field), while on a struct I can easily access it with just a '.' in between.
Is there a performance reason to use maps? Or am I blind to some other major reason? Because the need to always call Map.some_function to deal with maps seems quite more verbose than just going with a struct.