![]() |
|
|
What is your favorite collection type? |
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,070
Name: John Alexander
|
In the old days there were arrays. Basic gave you dynamic arrays that could be redimensioned, even while preserving their data. This was expensive, but it would also be expensive to declare an array as large as you might ever need, and let most of it go wasted. C++ programmers came up with the linked list to solve this problem.
We've come a long way since then. There are linked lists, hash tables, arrays, sorted dictionaries, and the like. In the .NET world, we have typed (generic, like from templates) and untyped (System.Object with boxing and unboxing) collections. Which ones do you find yourself using regularly?
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
|
|
|
| Sponsored Links (We share ad revenue): |
|
|
Re: What is your favorite collection type? |
|
Half Man, Half Amazing
![]()
Latest Blog Post:
North Lake Union Posts: 2,917
Name: Forrest Croce
Location: Seattle, WA
|
I tend to use my own collection that decorates a Dictionary<T, T> and List<T> myself. Depending on the situation, I usually need to get at an item either by its key or ordinal, and both of these support one or the other. SortedList<T> offers both, but the performance hit compared to hashing is too much.
|
|
|
|
|
|
Re: What is your favorite collection type? |
|
Ultra Talker
Posts: 271
|
i liek to collect domains
is that eligible? hehe
__________________
Make More $$$ |
|
|
|
|
|
Re: What is your favorite collection type? |
|
Moderator
![]()
Latest Blog Post:
My Favorite Isaac Asimov Story Posts: 4,070
Name: John Alexander
|
Domains of objects, or swamp domains, like the frog who climbed the reed and said "This is my domain - I'm king of all I see?"
![]()
__________________
HungarianNotation is the last resort of scoundrels. Why not the first resort? That's where it counts! |
|
|
|
|
|
Re: What is your favorite collection type? |
|
Weightlifting CS Student
Posts: 480
Name: Nick Ohrn
|
I find myself using a List in almost every single program I write. It is a good approximation for a real world list and can be easily databound to UI elements. I used a dictionary for the first time the other day, and it seems to work out pretty well, also. I might try to use them more when the situation calls for mapping one thing to another.
__________________
NickOhrn.com - My personal haven of insight to offer the world. Plugin-Developer.com - Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others. |
|
|
|
|
|
Re: What is your favorite collection type? |
|
Novice Talker
Posts: 6
|
List, Hashtable, Dictionary and NameValueCollection for me.
|
|
|
|
| Sponsored Links (We share ad revenue): |
| Thread Tools | |
|
|
| Webmaster Resources Marketplace: |
| Software Development Company | Webhosting.UK.com |
| Web Templates | Text Link Brokers | Stock Photos |