exoteric said:exoteric said:*snip*So let me boil it down to its absolute undeniable essence
STuple pros
- structs; for performance reasons (makes sense for tuples as most tuples are less than 10 elements)
- recursion; for composition (tuple.Rest rather than new Tuple<A,B>(tuple.Item1, tuple.Item2); to be fair: representation bias)
- enumeration; for composition (use tuples directly as sequences which, intuitively they are)
Tuple pros
- classes; for nominal typing (: INominal<T>)
- flatness; for ease of comprehension and simplicity
- non-enumeration; unmistakeable distinctness, no accidental application of abstraction
The tension here is somewhat like structural vs nominal typing. Is it a duck if it looks, walks and quacks like a duck or is it only a duck if it has duck painted over it?
These are choices. Being aware that there are choices being made for you and what the trade-offs are, is useful. I'm sure there are good reasons for the current design - nevertheless it is interesting to examine other paths of expression
> recursion; for composition (tuple.Rest rather than new Tuple<A,B>(tuple.Item1, tuple.Item2); to be fair: representation bias)
I would call .Rest.Rest.Rest.* a bad design rather than a different representation, get a better name and I may change my mind ![]()
> enumeration; for composition (use tuples directly as sequences which, intuitively they are)
And how are you going to enumerate them, return a IEnumerable<object>? That surely ain't cool.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.