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

ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.