Hacker News new | ask | show | jobs
by akavi 2537 days ago
`map` is strictly less "powerful" than a "loop", so I'd argue that's misleading.

Which I'd also argue is a good thing. Using the least powerful construct available both communicates to future readers of the code, and allows higher level optimization (eg, `map` is trivially parallelizable, an arbitrary loop is not)

1 comments

But `map` is not a primitive. It's just a function implemented with... a loop. It's hard to argue that that doesn't make it "some kind of loop".