Many devs are probably already familiar with map/filter/reduce, but they know it in a different form: SQL.
SELECT is map
SELECTsales_volume>10000ASis_preferred_member...
WHERE is filter
SELECT...WHEREorder_status='open'
GROUP BY or aggregate functions like SUM are forms of reduce
SELECTSUM(order_total)...
Once I realized that, it seemed only natural that the same capabilities be available in my programming language for in-memory collections too. You could already do them in for loops of course, but adding these explicit operations to the language saves the code and mental weight from the overhead of the loop. And more importantly, it makes the commonly-performed operation obvious, whereas a for loop has to be read line-by-line to make sure of what it is doing.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Many devs are probably already familiar with map/filter/reduce, but they know it in a different form: SQL.
Once I realized that, it seemed only natural that the same capabilities be available in my programming language for in-memory collections too. You could already do them in
for
loops of course, but adding these explicit operations to the language saves the code and mental weight from the overhead of the loop. And more importantly, it makes the commonly-performed operation obvious, whereas afor
loop has to be read line-by-line to make sure of what it is doing.