Wednesday, April 23, 2014

Difference between List and Collection

The tutorials I posted in the post titled Microsoft C# .NET Data Structures Lessons are based on .NET 2.0. As you are hopefully aware, the .NET CLR (Common Language Runtime) is currently sitting at version 5.0 while the programming language C# .NET is currently at version 4.5 as of June 2013 (according to this Wikipedia article on C#).

I found my way over to this StackOverflow question and answer while trying to figure out the difference between a List and a Collection. If the post is correct, a Collection implements IList but is different from a List in that it is extensible (it can be modified, enhanced, and added to). Pretty cool. The reason I mentioned the tutorials and their versioning is that Collections as of C# .NET 3.5 are no longer part of the System.Collections.Generic namespace. Good thing I looked this up or it would be back to Google when I tried to implement Collection and couldn't find it.