Normally, I program .NET in C#, but currently I am updating a project written in VB.NET and have noticed a curious syntax being used in For Each loops.
Is there any difference between
For Each x in collection.Items
...
Next
and
For Each x in collection.Items
...
Next x
?
I have seen both in the code here and was curious why someone would use the second variation.
This is specified like so on the MSDN Reference:
Original can be found here – fifth para under Remarks section:
http://msdn.microsoft.com/en-us/library/5ebk1751.aspx