Thursday, December 15, 2005

Using Collections in .NET [UPDATED]

How and when to use the various collections and other aggregators or an array has been an ongoing question for me. There is/are a variety of classes in the FCL which provide collection-type containers. How do you decide which to use when? Here are some references I have found helpful. But no conclusions yet.

I think the discussions are good in the books of Francesco Balena, Jeff Richter, and others:
Authors I like include Ken Getz and Paul Sheriff, but I don' find articles by them on this.

Articles I have found:
Scott Mitchell has some articles at his 4GuysFromRolla site:
Chapter 2 (from his ASP.NET: Tips, Tutorials, and Code book) compares 5 types of collections: ArrayList, Hashtable, SortedList, Queue, and Stack. After discussing each one individuality he shows their similarities and demonstrates the use of the IEnumerator interface to access them.
Specialized Collections is a useful article at MSDN.
Not to mention his series An Extensive Examination of Data Structures at MSDN.

Related Blog Postings:
Collection classes and behavior by Yves Reynhout
Article: OOP and Security sometimes go hand in hand by Tobin Titus

The new version 2.0 of the Framework will apparently extend the functionality of collections. Obviously the availability of generics is significant; plus some new extensions to the actual object collection classes. No refs yet for them.

CodeSmith by Eric Smith may be a good way to generate code for collection classes. http://www.ericjsmith.com/codesmith/default.aspx

[Original post 5/15/2005]
Delegates in C# vs VB.NET down to the IL

Thursday, December 08, 2005

C# posts on several topics

I know the answer (its 42) is "Abhinaba's blog on C#, Team Build (VS Team System), and all other things". It has a number of interesting posts with numerous comments.

C#: Anonymous methods are not closures, led to extended and interesting discussion.

C# : Enum and overriding ToString on it:

His introduction:
"I saw two posts on Enums today on
Eric Lipperts and Chris Rathjen's blog. Enums are significantly different from the other types and people run into unusal problems while working with them. "
He discusses the issue I have faced:
"This is a common issue that comes up frequently when you want to show values in reports, web pages, XML where you want to put in human readable text for enum values. Commonly people use non-generic solution of maintaining arrays of these descriptions and get text out of them by indexing using the enum value or some other things like storing it in a hashtable and using the ToString value as the key to get the desciption out."

Wednesday, December 07, 2005

Internet Wayback Machine

Checking into iPodder and other podcasting tools I came upon articles about a feud between Dave Winer and Adam Curry. This led eventually to some article posted on the "Internet Wayback Machine". That is a terrific site which has been taking snapshots of websites since 1996.


About the Wayback Machine
Browse through 40 billion web pages archived from
1996 to a few months ago. To start surfing the Wayback, type in the web address
of a site or page where you would like to start, and press enter. Then select
from the archived dates available. The resulting pages point to other archived
pages at as close a date as possible. Keyword searching is not currently
supported.