this practice of letting every function, or method, perform only one task is called keeping functions pure.
6 Simple Tips on How to Start Writing Clean Code
Alex Devero
4.2K19

Purity has nothing to do with the size or specialization of a function. You can write a pure function that does a lot of stuff, it just has to be side-effect free and return the same value given the the same inputs.

That said, thinking about functions in a mathematical (functional, pure) way tends to lead to smaller, more specialized (and composeable) functions.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.