Replies: 1 comment
-
Hi @gyoce, In most cases, we are browsing code using an editor/IDE that allows me to hover over the type and see the type if I am unsure. Yes, browsing on GitHub doesn't always give you that options, so you lose some info, and when I am showing code in slides/presentations, I tend to show types explicitly, but not in codebases I am maintaining. In this codebase we are generally following Microsofts/dotnet's coding standards with a few exceptions, and this is pretty much aligned with most code bases I see in .NET. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I was wondering why there are a lot of "var" usage instead of real type. I mean, i know that in some cases the "var" is okay because you can easily see the type on the right of the '=' but sometimes it's not that easy.
For me there are some cases that justify the use of var :
I think in terms of code lisibility it's better to use the real type, see below for examples that for me the use of the real type is better for code understanding :
I think there are some cases that do not justify having "var" :
If there is a reason or if i'm wrong i would like to know and understand why 😃
Thank you !
Beta Was this translation helpful? Give feedback.
All reactions