What is wrong with SortedList<T>

time to read 1 min | 74 words

Today it has arouse my ire. Take a look at the IndexOfKey, IndexOfValue and RemoteAt methods.

image

You would expect a list to have a way to get to item by index, certainly based on methods such as RemoveAt and IndexOfXyz.

It doesn't have such a way. You have to violate the Law of Demeter in order to get it to work, list.Values[i], yuck!