Is an Arraylist still in use?

Published on
-
1 min read

When I first started using ASP.NET 1.1, I always used an Arraylist to iterate through most of my collections. However, when I started using ASP.NET 2.0 I was introduced to Generic Lists. The List<T> class is the generic equivalent of the ArrayList class. It implements the IList<T> generic interface using an array whose size is dynamically increased as required. This means the List class performs much better in most cases and more importantly it is "type" safe.

So I am not too sure why you would ever need to use an Arraylist since a Generic List class is able to do exactly the same thing with the added benefit of extra perfomance. So is the Arraylist still widely used in todays standards? I guess it still must be in use if Microsoft has not omitted it from their Framework. Maybe Microsoft has something in store for the Arraylist in their grand plan.

Here are a few useful links:

C# Corner - C# Generics Josh Williams MSDN Blog - Arraylist vs. Generic List MSDN Network - List (T) Generic Class

Before you go...

If you've found this post helpful, you can buy me a coffee. It's certainly not necessary but much appreciated!

Buy Me A Coffee

Leave A Comment

If you have any questions or suggestions, feel free to leave a comment. I do get inundated with messages regarding my posts via LinkedIn and leaving a comment below is a better place to have an open discussion. Your comment will not only help others, but also myself.