The “obvious” answer would be “enumerable”, but that just sounds wrong, saying “I have an enumerable containing all of our customers” or whatever. In the past I might have said “list” or “collection”, but that’s not accurate because not all types implementing IEnumerable
are lists or collections;
some of them are just wrappers around iterators. Lately I’ve started saying “sequence” but I’m not sure if that’s correct; it is accurate in terms of the behavior of IEnumerable
but there might be some nuance I’m missing… what do you all call these objects?
Microsoft used Enumerables
here: https://docs.microsoft.com/en-us/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8
Enumerable is the correct term. An enumerable is something that can be counted/accessed one by one, which is literally what an IEnumerable is.
By implementing IEnumerable you are saying that your data can be accessed one item at a time, regardless of how it’s being stored/each item is accessed internally. As a result, any attempt to refer to it by the data structure would be very cumbersome.
There’s nothing wrong with saying you have a collection of customers, but an enumerable of customers provides more information.
I don’t clearly understand why it sounds wrong to use the exact name of what something is to describe it; “I have an enumerable containing all of our customers” sounds perfectly reasonable to me.
I guess it sounds weird because “enumerable” sounds more like an adjective than a noun. I know adjectives can often be used as nouns in English, but I don’t really like doing so as it just looks wrong!
I’d call it an enumeration or enumerable.
Most of the official documentation says that a function “takes a sequence…” when referring to an IEnumerable parameter
Enumeratorable??
no
An enumeration is a census of objects. A queue is not an enumeration, it is a collection.
C# devs
null reference exceptions