Alex Rivera | Logout

What and When to use Tuple?

Asked 2012-11-30T06:47:32.407
132

May someone please explain what a Tuple is and how to use it in a Real World Scenario. I would like to find out how this can enrich my coding experience?

Edit
Report

1 Answer

42

The difference between a tuple and a class is that a tuple has no property names. This is almost never a good thing, and I would only use a tuple when the arguments are fairly meaningless like in an abstract math formula Eg. abstract calculus over 5,6,7 dimensions might take a tuple for the coordinates.

answered 2012-11-30T09:07:25.367

Your Answer