News for hackers. Stuff that matters.
Re:Total Functional Programming (2004) [pdf] by thfuran on Thursday March 07, 2024 @08:06AM (#39628593)
>Reactive programming frameworks that execute callbacks in response to events can cause really weird bugs if the callback mutates state somewhere

What's the point of a callback that doesn't mutate state somewhere?

Re:Total Functional Programming (2004) [pdf] by mightybyte on Thursday March 07, 2024 @08:34AM (#39628846)
It allows you to separate non-stateful business logic from the stateful update logic. Reactive frameworks usually handle the state mutation for you, eliminating the potential for UI glitches where something that depends on the updated state doesn't get recomputed/redrawn.
Re:Total Functional Programming (2004) [pdf] by andyferris on Thursday March 07, 2024 @08:24AM (#39628750)
A lot of “dependency injection” type frameworks run this way.

The framework or runtime calls your function, and the return value tells it what to do next.

Prominent examples include React and Excel.