Elixir structs vs Erlang records

To be honest, I think the readability of map-based structs is greatly improved because of Elixir’s syntactic sugar that turns %{a: 1, b: 2, __struct__: Foo} into %Foo{a: 1, b: 2}. But of course even without that you are able to see the names of the different fields; is this what you mean?

As for upgrading: This is definitely a place where map-based structs are better than tuple-based records! :+1:

2 Likes