Hacker News new | ask | show | jobs
by Pxtl 1171 days ago
Well, the complaint in the article is that the idiomatic way is kind of inscrutable. I'm more than willing to let pragmatism win in those cases, since so many languages make this pattern a nuisance instead of providing a simple "enumerate this array with index" out-of-the-box as part of the standard library. IIRC you have to roll your own in Java, C#, and Powershell.
1 comments

In C# there's a .Select overload, that gives your lambda both item and its index.