In a typical imperative application, business logic and side effects are inextricably linked. For example, when you write await db.checkInventory(…), the runtime immediately reaches out to the database. Our Effect System works differently. When our code needs to check inventory, it doesn’t call the database; it returns a plain object instead, which will be executed later by an interpreter.

#programming #javascript

https://lackofimagination.org/2025/12/testing-side-effects-without-the-side-effects/

Testing Side Effects Without the Side Effects

In a typical imperative application, business logic and side effects are inextricably linked. For example, when you write await db.checkInventory(…), the runtime immediately reaches out to the database. Our Effect System works differently. Instead of performing the action, our functions return a description of the action. When our code needs to check inventory, it doesn’t call the database; it returns a plain object instead, which will be executed later by an interpreter.

Lack of Imagination

@aycangulez Interesting post.

Please fix your CSS for code blocks in non-dark mode:

@emilis Thanks! That's strange. The code blocks aren't displaying for me the way you've shown. I've tested this in both light and dark modes using Safari and Chrome.
@aycangulez Check with JS turned off :)