4 ms·
> In my 10+ year programming career not once have I ever wished something was functional. I.. have trouble with this statement. I bet you have, but you thought
by boxed 3y ago
> In my 10+ year programming career not once have I ever wished something was functional.
I.. have trouble with this statement. I bet you have, but you thought about it differently. A function that COULD be a pure function but that takes some data structure then mutates it and returns nothing, well that's just bad programming.
Now, wanting the entire program to be functional, that's a different matter.
- pdntspa 3y ago> well that's just bad programming. There are a lot of situations where it is/may seem prudent to pass a reference to something, mutate it, then return
- hmmokidk 3y agoOnly reason I can think of is performance.
- pdimitar 3y agoYou can do that in Erlang/Elixir too, though you are passing a name/ID of the thing, not a reference to the thing itself (not in the sense of C/C++ or Rust references anyway).
- boxed 3y agoThere are. Yes. But the previous poster seems to imply they have NEVER seen code written like that that would be improved by making it a pure function that returns a value for the caller to assign. Never? That seems unlikely to me. Unless they've only worked with really really amazing programmers. Even then it seems unlikely.