Skip to content

Conversation

@pkulikov
Copy link
Contributor

Removed not necessary first line.
Updated description of the default value expression to the one used in the C# Operators topic.

@pkulikov pkulikov requested a review from BillWagner as a code owner April 22, 2018 11:18
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

Thanks for updating this @pkulikov

Overall, it's much clearer. I had one comment, and one question for you.

- [The switch statement](switch.md): Specifies the default label.

- [Default value expressions](../../programming-guide/statements-expressions-operators/default-value-expressions.md): Produces the default value of the type. This will be null for reference types and zero for value types, and the 0 bit pattern for structs.
- [Default value expressions](../../programming-guide/statements-expressions-operators/default-value-expressions.md): Returns the default value of a type: `null` for reference types, zero for numeric types, and zero/`null` filled in members for struct types.
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to keep the term "Produces" instead of "Returns". Yes, this is a bit pedantic, but expressions don't "return", they are evaluated. Evaluation of an expression produces a result.

Another question: With the new wording, do you think nullable types need to be called out? They weren't earlier, and it both versions, the behavior for default(int?) is hinted at but not stated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BillWagner as for "Produces", I see your point and agree. Will update it and thank you for the clarification.

As for the explanation text, I've thought about removing it at all and having just Produces the default value of a type. Thus, inviting a reader to follow the link (I'll make another PR to update the actual topic that describes default value expressions) that provides more details. As for now, there are three places in docs where we explain default type values. What do you think of it?

Copy link
Contributor Author

@pkulikov pkulikov Apr 23, 2018

Choose a reason for hiding this comment

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

And question: is it possible that folks think of int? as a numeric type? If yes, then they might misread the text.

Copy link
Member

Choose a reason for hiding this comment

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

As for now, there are three places in docs where we explain default type values. What do you think of it?

Yes. I like that idea.

is it possible that folks think of int? as a numeric type? If yes, then they might misread the text.

It is. That's the best case for calling it out explicitly.

Copy link
Contributor Author

@pkulikov pkulikov Apr 23, 2018

Choose a reason for hiding this comment

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

@BillWagner I've updated both pages. Please check, if we understood each other correctly. The default value expression page -> another PR.

@mairaw
Copy link
Contributor

mairaw commented Apr 24, 2018

@BillWagner tagged as changes-addressed for you to verify your feedback was taken care. Thx!

@BillWagner
Copy link
Member

Thanks for making the update @pkulikov I'll :shipit: now.

Thanks again.

@BillWagner BillWagner merged commit a7244fb into dotnet:master Apr 24, 2018
@pkulikov pkulikov deleted the patch-1 branch April 24, 2018 16:10
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.

3 participants