Vlad's Roam Garden

Powered by 🌱Roam Garden

function size isn't important

The core principle of writing good functions is . The block of the code should be extracted into the function if you have to spend mental effort while reading it to understand what it does. With the name of resulting function giving a clear answer to the "what" question.

This is another way of

At a first glance this seems like it contradicts . But that's not really the case - when you start following the underlying principle of - you'll notice your functions getting smaller. Usually ending up just a few lines long. So while the size in itself is not the point - keeping functions small can serve as a proxy/heuristic for the underlying principle.