Thoughts on Elixir, Phoenix and LiveView after 18 months of commercial use
Why do so many feel so strongly against state?In my 10+ year programming career not once have I ever wished something was functional. State simply is, dealing with it is a foundational concept in writing code."It's harder to test" -- so mock it in the tests."It's harder to reason about" -- you can see the references in your code and you can punch it into the debugger. If the state is implicit it is mentioned in the documentation that you've read right??"It's hard to tell where changes come from" -- again, stepping through with a debugger makes this somewhat trivial. Find the line that turns state bad, then drill into whatever that line calls, repeat.I'm not saying we should be adding external state willy-nilly. But it is hardly evil -- the dumb hacks that have appeared when a class or instance var would have done the trick boggle the mind.Can someone please prove to me how FP isn't just another cargo cult?