Sign in to follow this  
tensaix2j

Questions about VB.net collection

Recommended Posts

Functionality wise I think that the vb collection allows for using keys to identify elements, while the arraylist only allows indexing by order. So it's more of a dictionary vs a list.

Also, the arraylist stores the elements in an array - finding a particular index is then pretty fast, but if you go over the array size it has to reallocate it and copy values around, so you can incurr on fairly hefty performance issues.
It probably depends on what you're trying to use it for, but in general I'm willing to bet the ArrayList is better in most cases - the vb collection object was meant as a backwards compatibility class, and in general tries to be all things to everyone - usually that means sacrificing efficiency and/or memory to the altar or completeness.

One last note, the vb collection class is 1 based - I think there are other collections in the .net frameworks that are 0 based, which you may prefer using.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this