With map reduce I see the following:
- We've got an array
- We're going to loop through it and square everything
- We're going to take that and add it all together
- The result is r
When I read the for-loop counterpart:
- We have a variable called r that we're initializing to 0
- We're starting a loop with j as the index initialized to 0 iterating through an array
- We've got a variable x on each iteration that is the current position in the array
- We're adding the square of x to r
Maybe it's a personal quirk. for-loops make me feel stupid.