[erlang-questions] some patterns in questions.

Dmitry Kolesnikov dmkolesnikov@REDACTED
Tue Oct 23 15:12:30 CEST 2018


Hello,

Thank you for asking ;-) I’ll put my comments in-line

> 
> I'm polishing an api for a library that will be used by a lot of consumers. It seems important for me to respect much of the current expectations of Erlang developers, so I was wondering what people expect these days when using recent versions of Erlang > 20. 
> 
> * passing options to a function: would you still expect to use a `propslist` or a `map`? In which case are you using one or the other?

I am still using `proplists` in few of public projects. However, internally I do have trend of switching to maps. Proplists has a good feature of supplying a boolean property, e.g. `read`. It might looks more awkward with maps #{read => true}. However, the usage of dict is preferable approached in competing languages (e.g. Go, Python, etc). 


> * database names for database embedded in an Erlang VM: would you expect to still use atoms like for `ETS` or `Mnesia` or would you use any of the following types: atoms, strings, binary? I'm thinking atoms are more optimised in their usage, but is this still true?

I would like to see a support for binary at embedded database. Atoms works fine if database is global or node-wide defined at boot time. However, I am also dealing with use-case where I need to create databases dynamically based on external input. I would prefer to use binaries for this, instead of converting binary to atom and back.

> 
> Any feedback is welcome :)
> 
> Benoît
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

I hope it helped!

Best Regards, 
Dmitry





More information about the erlang-questions mailing list