Local function vs Lambda C# 7.0

This was explained by Mads Torgersen in C# Design Meeting Notes where local functions were first discussed: You want a helper function. You are only using it from within a single function, and it likely uses variables and type parameters that are in scope in that containing function. On the other hand, unlike a lambda … Read more

What’s the difference between System.ValueTuple and System.Tuple?

What are ValueTuples and why not Tuple instead? A ValueTuple is a struct which reflects a tuple, same as the original System.Tuple class. The main difference between Tuple and ValueTuple are: System.ValueTuple is a value type (struct), while System.Tuple is a reference type (class). This is meaningful when talking about allocations and GC pressure. System.ValueTuple … Read more