© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•6mo ago•
6 replies
alex

Using 'var' instead of explicitly stating the type

JetBrains Rider suggests I change
CircleData[] circles = CircleRegistry.ToDataArray();
CircleData[] circles = CircleRegistry.ToDataArray();
to
var circles = CircleRegistry.ToDataArray();
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
var
whenever possible in C#? As someone with a bit of C++ experience this feels weird to me
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Comparing Types using local var Type type
C#CC# / help
3y ago
Using thumbprints instead of path to Certificate.
C#CC# / help
3y ago
❔ Exception while using .BindConfiguration instead of .Configure
C#CC# / help
3y ago
cannot convert from 'TypeA' to 'TypeB' with generics
C#CC# / help
2y ago