Vlad's Roam Garden

Powered by 🌱Roam Garden

reduce the number of things you need to be aware of to understand any given code block

Any given piece of code has the mental evaluation context required to understand it. people have a very limited short-term memory so you should strive to make this context as small as possible.

This means maintaining clear ways to supply dependencies to the code, minimizing the size of any given code block and [avoiding side-effects]([[side effects are confusing]])

The following things would help in achieving this as-well

The dependencies should be clearly defined and injected in the transparent way

Minimize usage of the [global entity]

Using them dramatically expands your evaluation context.

And if you must use them - inject them as any other dependency

[[Prefer transformation pipelines over loops]]

[[side effects are confusing]]