Still no first-class tuple support? Argh! All want is: var first, last = parseName(fullName); Instead of: String last; var first = parseName(fullName, out last);
Totally agree on the need for tuple syntax (and pattern matching to make it really useful): return Tuple.Create(foo,bar); Should be: return (foo,bar); The worst part is using the Item1..ItemN properties. One way I've gotten around it is to create a Tuple extension method called Apply [1]. I allows you to do this: ParseName(fullName).Apply((first, last) => ... ) That allows for giving names to the tuple ItemX fields a…
ParseName(fullName).Unpack(out string first, out string last);
However, this makes for essentially left-to-right assignment, which is contrary to the usual order. So this creates discontinuity when moving from one return value to two return values.