3 ms·
> Only the latter (that the order where pure functions are applied doesn't matter) has been touted forever as a benefit of functional programming, and what supp
by simoncion 11y ago
> Only the latter (that the order where pure functions are applied doesn't matter) has been touted forever as a benefit of functional programming, and what supposedly makes it "trivially parallelizable".
Functions that return the same values when given the same arguments are substantially easier to reason about than functions that return values that depend on both the arguments passed in and some state somewhere else in the system.
Additionally, functions that don't modify their arguments are relatively easy to parallelize. (Due in part to the fact that it's really easy to figure out locking in a share-nothing system.)
Anyway. I'm no scholar, but I'm pretty sure that no knowledgable FP proponent has ever seriously said "FP lets you call your pure functions in any order whatsoever and get the same end result, every time.". Perhaps I'm misunderstanding your statement?
- the_af 11y agoEspecially since shuffling the order functions get called often means they do NOT get called with the same arguments. This is important!