Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you are working with C# these functions are available in linq: map is Select, filter is Where, and reduce/inject/fold is Aggregate in Microsoft speak.

I use those methods all the time when I have to do C# code.

I do wonder why these operations lack a standard name. Still, I think map-reduce sounds a lot better than map-inject or Select-Aggregate or map-fold.



If you're already familiar with SQL (which your average C# programmer likely is), select/where/aggregate look familiar to you, so less of a mental leap to understand them. And being able to say 'it's like in-line SQL!' makes Linq more acceptable to pointy-haired-bosses at the same time.


Easily fixed with extension methods for aliases you like.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: