In my code I have a function that processes some data and then return a list that should be sorted. I have 2 options for the return: - SortedSet - List (but it will be sorted)
The only operation done on this return type so far is iterating.
Argument for SortedSet: - It forces the items returned to be sorted - It implies the items returned are sorted
Argument for a List: - The caller does not need a Set (and its complex functionality), all he needs is a list of items that are promised to be sorted. - Keeping the interface simple (no SortedList)
What do you think?