C#

C#

Made by DeepSource

Deconstruct tuple expression to avoid repetitiveness CS-R1133

Anti-pattern
Minor

C# allows you to declare tuples using parenthesis. However, if you wish to declare multiple variables, consider deconstruction/unpacking the variables by using a single var keyword. In short, you can deconstruct a tuple that's been declared as (var x, var y, var z) as var (x, y, z).

Bad Practice

(var x, var y, var z) = (0, 0, 0);

Recommended

var (x, y, z) = (0, 0, 0);