Using 'var' instead of explicitly stating the type
JetBrains Rider suggests I change
CircleData[] circles = CircleRegistry.ToDataArray();
to var circles = CircleRegistry.ToDataArray();
with the warning:
Use 'var' (elsewhere)I understand this is just coding style, but is it considered standard practice to use
var
whenever possible in C#? As someone with a bit of C++ experience this feels weird to me4 Replies
well, one could call it contentious
but many C# developers use
var
in all possible cases, yesdo you know why? or is it just how it is in many style guides
because it is shorter and easier to type
okay, thanks for the help
C# style seems so strange sometimes