Re:Elm, Elixir, and Phoenix: Reflecting on a Functional Full...
by rdtsc on Monday March 05, 2018 @01:32PM
(#16523158)
I am using both, and I find that at least in Python I started using more functions and passing the state around. A nice side-effect is that also makes that code more testable as there is less need for mocks (since functions are more pure), but it's also more verbose and people think I am crazy now.
Though also Python in a sense already has some extra state visibility by passing self around in member function as opposed to hiding in an implicit this.
Re:Elm, Elixir, and Phoenix: Reflecting on a Functional Full...
by macintux on Monday March 05, 2018 @02:49PM
(#16523798)
Yeah, I implemented a state loop since my process is relatively short-lived. I'm sure anyone who knows Python would hate my code, and I'm not particularly proud of that: I simply don't know the usual idioms.
I was excited when I discovered accidentally that tuple unpacking in function heads was supported in Python, then depressed when I discovered that was dropped in Python 3, "because no one uses it". Sigh.
I love useful constraints.