Build at a Single Level of Abstraction

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. It turns out that we can handle many different abstractions if those abstractions are well named, well organized, and close together. This concept is the single level of abstraction[16] principle introduced by Bob Martin in Clean Code: A Handbook of Agile Software Craftsmanship [Mar08].

Choose a Random Question

The single level of abstraction principle says that each line of a function or method should be at the same level of abstraction. It’s a tough principle to articulate, but ...

Get Designing Elixir Systems With OTP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.