Search⌘ K
AI Features

Naming Concepts with Functions

Explore how to enhance code readability and maintainability by using descriptive function names to represent key concepts in Elixir, following principles of single-purpose functions. Understand how naming replaces comments to let the compiler check your logic and create a more modular, functional core.

We'll cover the following...

Naming matters

Sometimes, when we have a concept in our code that needs a description, it’s tempting to reach for a comment. Instead, think about whether there’s a way to name the concept with code. A new variable or a function with a descriptive name is better than a comment, because those concepts get checked by the compiler, and comments don’t.

For example, in the first version of ...