Locality of Behavior (LOB) Principle: The behaviour of a unit of code should...


Locality of Behavior (LOB) Principle:

The behaviour of a unit of code should be as obvious as possible by looking only at that unit of code.

Locality enables a programmer to understand the source by looking at only a small portion of it.

Note: DRY and Separation of Concerns fight against LOB. So find a balance.

More: https://htmx.org/essays/locality-of-behaviour/

View original on X