VBCorLib for VB6

Monday, October 31, 2005

My Current Favorite Class... ArrayList

When ever I start a new project I select the custom Library project with a reference to VBCorLib already selected. I don't even give it a second thought. I just expect the functionality to be there. So with all of that functionality available to me what do I usually use first?

Well, when creating a class that contains items I reach for the ArrayList first. Why? I know I could use the Collection class or an array. Do I just feel safer with an ArrayList? Maybe it's because I know how it works and it's about as effecient as can be with indexed lookups? Or maybe it's because it has all sorts of list manipulation capabilities that I feel like I won't have to change the type of collection or add additional functionality to manage a different collection type later on in the coding process.

In my current project I store objects. It's easy enough to store them in any type of container, but I needed one functionality and didn't want to have to code too much. I needed to be able to sort the objects in the list. Immediately the Collection class is out. Oh sure you could sort it using the hardest method possible. I could easily sort an array of objects using VBCorLib. But, when it comes down to it, I don't like having to manage an array directly. So, unless there is a pressing reason for the quickest access to the objects in a list, I choose an ArrayList and provide a custom IComparer object when sorting the items. What could be easier?

I use other classes in VBCorLib, but my first class is usually the ArrayList allowing for easy manipulation of list data.

-Kelly

A RoadMap?

Well, I've been asked about a roadmap for VBCorLib. To be honest I haven't given it much thought. I pretty much just used the .NET mscorlib as a guide for what to implement in my library and stopped there.

The library itself compiles to about 2.5 megs. I am hesitant to expand on the library's functionality to keep the size down. If I were to start adding functionality I would most likely start another library that depends on VBCorLib. But as it stands I really don't have any plans in the works.

I've been quite busy with work related projects. I do use VBCorLib in those projects and have become quite dependant upon it.

So in order for either VBCorLib to be expanded or a new library to emerge then I would need both time and a direction, and at the moment I have neither. Of course everyone is welcome to send me suggested functionality just incase a new library is started.

-Kelly