Guidelines for Proplist Usage
Based on collective wisdom accumulated over decades of Erlang development:
- Use proplists for function options unless the options are numerous (>20) or performance-critical
- Always provide default values using either
get_value/3or the append-defaults pattern - Document expected options clearly, especially boolean shorthands
- Consider maps for new APIs but don’t feel compelled to break compatibility
- Use normalization when accepting user input that might use variant keys
- Validate required options early in your function, not deep in the logic
- Don’t nest proplists deeply—if you find yourself doing
get_valueon aget_valueresult, you probably want records or maps - Remember that atoms as booleans must be lowercase—
'Trueand'trueare different atoms