> Yep, I agree with this. This is what I usually try in Python. Granted, Python is a way worse vehicle for FP than Elixir is, but I try to keep my procedures as pure functions as far as possible with not too big sacrifices in readability and performance. Most of the time a functional solution can be found, even in Python.
That's really interesting. The last time I wrote any serious Python was back in the Python 2 era, so it's been a hot minute, but that Python certainly didn't feel very amenable to FP. Nice to hear that it's turned a corner. I'll keep an eye out for any use case where I could give FP-flavoured Python a spin.
> And maybe I am a little bit delusional thinking this, but in my experience, when you think deeply and come up with strict FP solutions, and you know what you are doing, then a lot of type issues don't arise, or are obvious to avoid. The simple fact that one thing you initialize once doesn't change over the course of its lifetime, already avoids tons of mistakes. You simply don't get this "Oh, is at that point in time that member of object x already modified, to be value y?" shit.
I very much agree with this, and I wish more FP evangelism focused on the many wonderful emergent properties of FP systems in production, instead of cutesy maths cleverness that turns off more people than it attracts (and those that it attracts were always going to be functional programmers to begin with).