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

I'm only 90% sure I know the syntax of a for loop in my chosen language, C#. The reason for the missing 10% is that I never write this syntax.

Most loops are covered by a foreach or by LINQ (think: map and reduce, buy nicer).

The few times I actually need a for loop I type: "for" <press enter> <type the limit for i> <press enter> and then I focus on the loop body. If my needs are more complicated, I _modify_ the for loop my IDE gives me.



Yea I meant a for-each loop.


I'm not sure the last time I wrote a for loop that wasn't for-each.




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

Search: