Why Tuple’s items are ReadOnly?

Tuples originated in functional programming. In (purely) functional programming, everything is immutable by design – a certain variable only has a single definition at all times, as in mathematics. The .NET designers wisely followed the same principle when integrating the functional style into C#/.NET, despite it ultimately being a primarily imperative (hybrid?) language.

Note: Though I suspect the fact that tuples are immutable doesn’t really make your task much harder, there are also anonymous types (or perhaps just a simple struct) you might want to use.

Leave a Comment