Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 856535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:14:59+00:00 2026-05-15T08:14:59+00:00

In C#, I find myself using a List<T> , IList<T> or IEnumerable<T> 99% of

  • 0

In C#, I find myself using a List<T>, IList<T> or IEnumerable<T> 99% of the time. Is there a case when it would be better to use a HashTable (or Dictionary<T,T> in 2.0 and above) over these?

Edit:

As pointed out, what someone would like to do with the collection often dictates what one should be using, so when would you use a Hashtable/Dictonary<T,T> over a List<T>?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:15:00+00:00Added an answer on May 15, 2026 at 8:15 am

    Maybe not directly related to the OPs question, but there’s a useful blog post about which collection structure to use at: SortedSets

    Basically, what you want to do with the collection determines what type of collection you should create.

    To summarise in more detail:

    • Use IList if you want to be able to enumerate and / or modify the collection (normally adding at end of list)
    • Use IEnumeration if you just want to enumerate the collection (don’t need to add / remove – usually used as a return type)
    • Use IDictionary if you want to access elements by a key (adding / removing elements quickly using a key)
    • Use SortedSet if you want to access a collection in a predefined order (most common usage being to access the collection in order)

    • Overall, use Dictionary if you want to access / modify items by key in no particular order (preferred over list as that’s generally done in order, preferred over enumeration as you can’t modify an enumeration, preferred over hashtable as that’s not strictly typed, preferred over sortedlist when you don’t need keys sorted)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Often when I'm using Python I'll find myself writing list comprehensions that look something
I find myself often using a pattern where I transform a list with a
I'm using Java 6. Sometimes I find myself doing something like this. Map<String,List<Integer>> myMap;
I find myself using Resharper's convert to auto property refactoring a lot to remove
I find myself using this method a ton to perform actions based on a
I find myself using the current pattern quite often in my code nowadays var
I find myself using hash arguments to constructors quite a bit, especially when writing
I often find myself using Integers to represent values in different spaces. For example...
Very often, I find myself using a callback function and I don't have its
Although using SQL FOR XML EXPLICIT is cumbersome, I find myself using it often.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.