Live data from Hacker News

All programming philosophies are about state

worldofbs.com

1–10 of 254 posts

Re: All programming philosophies are about state

#3
"Functional - Modifying state is hard to get correct; keep it at the boundaries and keep logic pure so that it is easier to verify the logic is correct."

My main beef with functional programming is that you essentially put the state in the "instruction pointer" and its history of walking the call stack instead of bound to symbols. It does not fit my way of thought. I personally prefer more or less statemachines.

Re: All programming philosophies are about state

#5

"Functional - Modifying state is hard to get correct; keep it at the boundaries and keep logic pure so that it is easier to verify the logic is correct." My main beef with functional programming is that you essentially put the state in the "instruction pointer" and its history of walking the call stack instead of bound to symbols. It does not fit my way of thought. I personally prefer more or less statemachines.

You don’t need history. Embrace one way data flow and your life will be simpler and more easy to reason about.

Re: All programming philosophies are about state

#8
That doesn't really seem like a good summary of functional programming. It has state all over the place. But it's true that functional programming is about state management. I'd argue that the functional approach to state management is to make state explicit and visible.

Re: All programming philosophies are about state

#9

"Functional - Modifying state is hard to get correct; keep it at the boundaries and keep logic pure so that it is easier to verify the logic is correct." My main beef with functional programming is that you essentially put the state in the "instruction pointer" and its history of walking the call stack instead of bound to symbols. It does not fit my way of thought. I personally prefer more or less statemachines.

I think what you're missing is that functional programming is about referential transparency. There should be no need for an instruction pointer in your mental model.
Post reply on HN