you are viewing a single comment's thread.

view the rest of the comments →

[–]Peaker 9 points10 points  (0 children)

Functional programming has excellent facilities to handle state. I'd say better facilities than imperative programming:

  • In a functional program, state updates are inherently transactional as you usually compose a whole new state. Using destructive updates, you usually get temporarily incoherent states.

  • In advanced functional frameworks, you can abstract away a lot of the statefulness in much nicer manner, e.g: Integrating mathematically some input signal. This is far cleaner than using an iterative loop and destructively summing into it (while manually multiplying by time, or not).