4 ms·
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 s
by deltasquared 14y ago
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.
- ConstantineXVI 14y agoIf 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.
- gnaritas 14y agoEasily fixed with extension methods for aliases you like.