Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
What is your favorite collection type?
Old 04-18-2008, 03:57 PM What is your favorite collection type?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
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?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-23-2008, 12:24 AM Re: What is your favorite collection type?
Average Talker

Posts: 21
Name: LarryB
Trades: 0
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, 02:13 AM Re: What is your favorite collection type?
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 05-01-2008, 08:12 PM Re: What is your favorite collection type?
Average Talker

Posts: 15
Name: Chris
Location: UK
Trades: 0
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, 11:08 PM Re: What is your favorite collection type?
wogazm's Avatar
Ultra Talker

Posts: 274
Trades: 0
i liek to collect domains is that eligible? hehe
__________________

Please login or register to view this content. Registration is FREE
wogazm is offline
Reply With Quote
View Public Profile
 
Old 05-06-2008, 06:12 PM Re: What is your favorite collection type?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
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?"
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 05-07-2008, 01:22 AM Re: What is your favorite collection type?
Plugin-Developer's Avatar
Weightlifting CS Student

Posts: 504
Name: Nick Ohrn
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
- Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
Plugin-Developer is offline
Reply With Quote
View Public Profile Visit Plugin-Developer's homepage!
 
Old 05-11-2008, 07:28 PM Re: What is your favorite collection type?
vividearth's Avatar
Experienced Talker

Posts: 33
Location: London, UK
Trades: 0
List, Hashtable, Dictionary and NameValueCollection for me.
vividearth is offline
Reply With Quote
View Public Profile Visit vividearth's homepage!
 
Reply     « Reply to What is your favorite collection type?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.77593 seconds with 12 queries