10 Common Code Refactoring Experiences|Elixir “mix release” and missing dependencies

How to Use Elixir's Compiler to Avoid Typos

In this article, I want to describe how you can use elixir metaprogramming to avoid some runtime errors caused by typos. If you’re passing around some handcrafted messages ex. %{name: "app_one_hello", payload: "payload"} you can easily introduce errors. Sending app_one_hello and listening for app_ane_hello will not make your system works correctly. Imagine you have thousands of messages. It’s really hard to manage them like that. To make things better, you can create a list of all messages and generate functions to send and receive them. Now when you will create a typo, elixir’s compiler will tell you!

Full article here: https://puddleofcode.com/story/how-to-use-elixir-s-compiler-to-avoid-typos

Shameless plug: Check out @elixirstatus' other community project:

Credo, a new static code analysis tool that acts as a code linter, but also focusses on teaching coding practices and code consistency.