Tangentially related to Handling options in Erlang/OTP APIs - Chat / Discussions - Erlang Forums.
The convention is generally to use locally defined records for state in GenServers (et al.)
Are most developers persisting with this convention, or is there a gradual transitioning from records to maps?
A carefully crafted record (tree) outperforms maps and gives you
compile time checking of the keys, so they are not dead yet…
For state data, I generally prefer records over maps, both in
gen_statem implementations, mainly for the reason of compile time key checking.
I prefer records as well both in
It’s records for me, too State constructs as used in
gen_statem implementations as I use them do not need the flexibility of maps, instead the rigidity of records is IMO rather a benefit than a limitation there. The only time this gets in the way is when you are doing hot code upgrades that change the record structure, but personally I rarely need to do that.