Reputation: 4906
When should I use an Erlang record instead of a tuple? Or, visa-versa, when is a Erlang record unnecessary? I am relatively new to Erlang and I am not sure if I am using records and tuples properly. I understand from what I have read that records are essentially stored as tuples behind the scenes.
I typically use records for pieces of data that are going to be passed around the application or persisted somewhere. I use tuples things like the return value of a function, params of a function, and for things that are specific to the body of a function.
Am I using records and tuples correctly? Is there documentation outlining when one type should be used over another?
Upvotes: 2
Views: 450
Reputation: 18879
It is a style question. But do note:
Upvotes: 7