News for hackers. Stuff that matters.
Re:Why Functional Programming Should Be the Future of Software by throwawaymaths on Wednesday November 02, 2022 @10:49AM (#33436728)
I think you're completely missing an entire world of FP languages which are not pure like Haskell, ocaml, elm, etc... There are languages with side effects as an easily accessible escape hatch but don't do things which make debugging a pain like data encapsulation and inheritance.

Also, there are FP langs out there that have better data/heap locality with indirected pointer data structures, because they don't share memory and so the pointers aren't tied to anywhere except where they are directly running.

I completely disagree with immutability being non-intuitive. Try explaining to a junior/bootcamp JavaScript or python developer why when you pass an integer into a function it doesn't reflect changes you made in the called function when you jump back into your calling frame... But if you do the same with a object/dictionary...

For junior programmers immutable passing is absolutely the default assumption and so I think it's reasonable to claim it's the intuitive choice.

There's even crazymaking shit where in python if you have a default array parameter you can seriously fuck up your model of what's going on if you mutate that array anywhere.

There are no comments on this comment yet.