Reply
What is your favorite collection type?
Old 04-18-2008, 02:57 PM What is your favorite collection type?
Learning Newbie's Avatar
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!
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Sponsored Links (We share ad revenue):
 
Old 04-22-2008, 11:24 PM Re: What is your favorite collection type?
Administrator

Posts: 19
Name: LarryB
I find myself using List<T>, Dictionary<T,T> and ObservableCollection<T> like it's going out of style. I love those and can't imagine what I ever did with out them or LINQ.
LarryB is offline
Reply With Quote
View Public Profile
 
Old 04-23-2008, 01:13 AM Re: What is your favorite collection type?
ForrestCroce's Avatar
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.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 05-01-2008, 07:12 PM Re: What is your favorite collection type?
Average Talker

Posts: 15
Name: Chris
Location: UK
I tend to use either a List<> where im not fussed about being able to do a lookup or a Hashtable where I need to be able to do a lookup.

I would probably have shot myself a long time ago without these two.
__________________
Chris
.Net C# ASP.NET Developer
Windows Systems Administrator
crashed is offline
Reply With Quote
View Public Profile
 
Old 05-01-2008, 10:08 PM Re: What is your favorite collection type?
wogazm's Avatar
Ultra Talker

Posts: 271
i liek to collect domains is that eligible? hehe
__________________
Make More $$$
wogazm is offline
Reply With Quote
View Public Profile Visit wogazm's homepage!
 
Old 05-06-2008, 05:12 PM Re: What is your favorite collection type?
Learning Newbie's Avatar
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!
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 05-07-2008, 12:22 AM Re: What is your favorite collection type?
nickohrn's Avatar
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.
nickohrn is online now
Reply With Quote
View Public Profile Visit nickohrn's homepage!
 
Old 05-11-2008, 06:28 PM Re: What is your favorite collection type?
Novice Talker

Posts: 6
List, Hashtable, Dictionary and NameValueCollection for me.
vividearth is offline
Reply With Quote
View Public Profile
 
Sponsored Links (We share ad revenue):
 
Reply     « Reply to What is your favorite collection type?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML


Page generated in 0.18990 seconds with 14 queries