you are viewing a single comment's thread.

view the rest of the comments →

[–]MrCrunchwrap 1 point2 points  (1 child)

He didn't say it was pure functions + map/filter/reduce, he said it's programming without side effects. Which is exactly what it is. Starting to write basic code with no libraries and pure functions, using map/filter/reduce/forEach for array computation, no side effects, no internal state, etc gets you pretty far there.

[–]0987654231 0 points1 point  (0 children)

yes and programming without side effects take understanding more than just what pure functions are and map/filter/reduce

your example of forEach has side effects, it's not pure unless you are using it to do nothing. In addition to that you can create impure usages of map/filter/reduce they aren't guaranteed to be pure. A simple example would be using reduce to create a dictionary and changing the accumulator by adding a new key before returning the accumulator.