3 ms·
I think they're both equally correct, though the UFCS/pipe syntax is mentally easier to follow. Let's say someone told you (making up random stuff): "The abso
by gavinray 6y ago
I think they're both equally correct, though the UFCS/pipe syntax is mentally easier to follow.
Let's say someone told you (making up random stuff):
"The absolute value of the sum of the mean of the square of two vectors mapped over the product of X and Y."
Try to think about that in your head. By the time you've reached the end of the sentence, there have been so many steps and no context values that you can't even follow.
If you take the opposite though:
"Take the product of X and Y, map them over two vectors, square it, sum that, and then return the absolute value."
(Again, can't guarantee these are semantically equal to each other, but you get the idea)
Then you know "Okay, starting from these things, first I do this, then I do this.." whereas the opposite way, you're given a ton of directions with zero context, and then have to try to apply them all in reverse once you're finally given the starting value.
You don't give directions to someone starting from the destination and working backwards.
- ChrisRackauckas 6y ago>"The absolute value of the sum of the mean of the square of two vectors mapped over the product of X and Y." abs(sum(mean(abs2,x .* y)))?