Building at a Single Level of Abstraction
Explore the single level of abstraction principle to write clear and maintainable Elixir code. Understand how to organize functions at consistent abstraction levels while building a functional core for a quiz application. This lesson guides you through selecting questions and managing data flow using composable, well-named functions.
Handling abstractions
As we’re building the quiz, we’ll continue to build single-purpose functions that are easy to compose. One of the things that makes code easy or hard to read is the number of abstractions a programmer has to deal with at once. In programming, abstraction is just a way to simplify a complex idea or action. It turns out that we can handle many different abstractions if those abstractions are:
-
Well named
-
Well organized
-
Close together
This concept is the single level of abstraction ...