Rainer Schlonvoigt
01/27/2021, 9:25 AMSet<T>
and List<T>
are an option, which do you default to and why?Rainer Schlonvoigt
01/27/2021, 9:25 AMRainer Schlonvoigt
01/27/2021, 9:26 AMchristophsturm
01/27/2021, 9:27 AMchristophsturm
01/27/2021, 9:29 AMMatteo Mirk
01/27/2021, 9:31 AMCollection
in the interested API, so that it would accept/produce both without code changes and the preference would be a matter of requirement about duplicates or not, and/or performance; but those decisions can be made down the line, without breaking the APIRainer Schlonvoigt
01/27/2021, 9:35 AMMatteo Mirk
01/27/2021, 9:42 AMchristophsturm
01/27/2021, 9:55 AMMarc Knaup
01/27/2021, 10:18 AMList
and Set
have quite different meanings so it’s unlikely that both are equally an option. What’s the use case?
I usually do that:
1. List
if the order is relevant (in and out)
2. Set
if elements really must be unique (in and out, elements are typically simple)
3. Collection
if neither order nor uniqueness are relevant (in and out)