Hacker News new | ask | show | jobs
by jcromartie 3737 days ago
Are you sure we are talking about the same "functional programming"? Consider a function that parses a number from a string, and a function that doubles a number. How could anybody expect the order of these applications to not matter?
2 comments

Some people just oversell it, or don't think of the whole spectrum of commutativeness scenarios when they write about FP. I give several examples of that, lower in this thread, with links.

And it's exactly the same thing that the author of the original article discusses -- that order was supposed not to matter, but it does.

I don't think anybody ever meant to imply that pure functions can be composed in any order. That's the confusion here. "Pure functions can be run in any order" only means that they don't have side effects so one call doesn't impact another, but nobody ever meant or (hopefully) understood that to mean that the inputs and outputs of pure functions could be composed in any order. I don't even know what kind of confusion could lead to such an idea.
This is exactly what I was thinking.