Using `with` and `case` in Elixir
withto avoid nested
case if there is only one level…
3. …unless using
case leads to duplicated error handling
case if there are no clear success/error cases or more than two clauses and use
with if the result is clearly either success or error.
5. Only use
with with very restrictive matching
case when failure is the result of user/client input, that is, expected. Use
!functions when failure is not expected or would constitute a bug if it occurs.