Refactor to Array Initializer

Taking advantage of language features can make sleeker, easier to maintain code. One of these language features are array initializers.

Have you ever created an array, then assigned each element in the array? This incurs many lines of code with no tangible benefit. Check out this code from the NameMangler class in LINQ to XSD.

 

Read More

Print | posted on Wednesday, June 10, 2009 12:39 PM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)