3 ms·
> Sometimes simply reading a switch statement or if/else/then is much clearer Case statements are pretty common, and for code I read the with statement[1] is e
by ch4s3 6y ago
> Sometimes simply reading a switch statement or if/else/then is much clearer
Case statements are pretty common, and for code I read the with statement[1] is even more common. This allows you to code a happy path broken into small steps and then collect your edge cases. It doesn't solve every case for if/else or cases, but it's a nice tool.
[1]https://hexdocs.pm/elixir/Kernel.SpecialForms.html#with/1 https://hexdocs.pm/elixir/Kernel.SpecialForms.html#with/1
- strzibny 6y agoI love with, completely forgot to mention it.