December 2019
Intermediate to advanced
248 pages
5h 34m
English
You can tell a lot about a programmer by scanning code. For Elixir, this is especially true. When scanning Elixir, look for long pipelines, short functions, and skinny left margins. We’ve talked about designing for composition and single level of abstraction. Skinny left margins mean decisions are often made in pattern matches instead of control structures like if, cond, and case. Skinny left margins make single concept functions much more likely, and simplify tests. Let’s take an example.
When a user answers a question, the response may be correct or incorrect. We’ve built a boolean into our Response struct for the purposes of quickly making decisions with pattern matching. It looks like this:
Read now
Unlock full access