Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there no generic version of HybridDictionary?

Tags:

.net

generics

Apparently there is no generic version of a HybridDictionary.

Why is this? I always considered it to be a best-practice when you needed to store items in a dictionary, but didn't know how many items were going to be in it.

Maybe because the Dictionary<> has better performance and less overhead than the HybridDictionary, even with only a few elements in it.

Or is there a new best-practice I'm not aware of?

like image 889
Gerrie Schenck Avatar asked Mar 02 '09 08:03

Gerrie Schenck


2 Answers

IMO, HybridDictionary is just plain useless. Unless you're doing some microoptimizations (and even if this is the case you'd be better off with smartly indexed arrays with O(1) lookup time), there's absolutely no need in this class.

like image 195
Anton Gogolev Avatar answered Sep 22 '22 01:09

Anton Gogolev


The generic dictionary replaces Hybrid. The generic variants probably are hybrids, in the sense that they store and sort data in the most efficient way considering the amount of data to store.

like image 27
sindre j Avatar answered Sep 23 '22 01:09

sindre j