Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the when to use var coding guideline #3294

Merged
merged 2 commits into from
Mar 16, 2020

Conversation

nkolev92
Copy link
Member

Bug

Fixes: https://github.com/NuGet/Client.Engineering/issues/208
Regression: No

  • Last working version:
  • How are we preventing it in future:

Fix

Details: In #3247 (comment) myself and @donnie-msft had a discussion about the interpretation of the when to use var rule.

Here's my take on it.
Adding 2 examples that I think are valid.

I'll be happy to modify the PR based on the direction the discussions goes into.

Testing/Validation

Tests Added: No
Reason for not adding tests: doc update.
Validation:

Copy link
Contributor

@donnie-msft donnie-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 😅

@donnie-msft
Copy link
Contributor

Just to explain, I followed the Parse method and thought it was returning a different type.
I'm fine with Type.Parse returning Type being an acceptable use of var.

@nkolev92
Copy link
Member Author

Just to explain, I followed the Parse method and thought it was returning a different type.
I'm fine with Type.Parse returning Type being an acceptable use of var.

Can't say this hasn't happened to me before :D

docs/coding-guidelines.md Outdated Show resolved Hide resolved
@nkolev92 nkolev92 merged commit 06e2770 into dev Mar 16, 2020
@nkolev92 nkolev92 deleted the dev-nkolev92-updateCodingGuidelines branch March 16, 2020 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants