Vlad's Roam Garden

Powered by 🌱Roam Garden

separate intention from implementation

This is an "Orphan" page. Its core content has not been shared: what you see below is a loose collection of pages and page snippets that mention this page, as well as snippets of this page that were quoted elsewhere.

Referenced in

function size isn't important

At a first glance this seems like it contradicts functions should be small. But that's not really the case - when you start following the underlying principle of separate intention from implementation - 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.

function size isn't important

The core principle of writing good functions is separate intention from implementation. 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.