Reason for my vote of 5
Yep, thats what I do too. Having the var makes it even easier.
Just because one knows how to write generics, extension methods and lambda expressions is not reason enough to use it everywhere.
I don't like creating needless delegates; to my mind, simply creating a temporary variable is cleaner. I do wish there were a standard idiom for introducing a block purely for scoping purposes; "if(1)" seems a little icky, and blocks which don't control a conditional or looping construct often look like something's "missing". BTW, the "With" construct in VB can be used with value types in ways that would require multiple variables in C. For example, if Foo is an array of a value type, "With Foo(I,J)" will effectively latch the values of Foo, I, and J; I don't know if it avoids the recomputation of the array subscript for each access.
Last Visit: 31-Dec-99 18:00 Last Update: 25-Jun-16 9:39