Skip to content

add what's new in 7.2 #3672

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

Merged
merged 4 commits into from
Nov 15, 2017
Merged

add what's new in 7.2 #3672

merged 4 commits into from
Nov 15, 2017

Conversation

BillWagner
Copy link
Member

Create the "What's new in C# 7.2 topic.

@BillWagner BillWagner changed the title [WIP] add what's new in 7.2 add what's new in 7.2 Nov 14, 2017
@BillWagner
Copy link
Member Author

This is ready for review.

/cc @jcouv

- The `readonly struct` declaration indicates that a struct is immutable and should be passed as an `in` parameter to its members methods.
- The `ref struct` declaration indicates that a struct type accesses managed memory directly and must always be stack allocated.

You can read more about all these changes in [Using value types with reference semantics](../ref-locals-and-returns.md).
Copy link
Member

Choose a reason for hiding this comment

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

This link is broken, or maybe not published yet. The URL worries me, as it seems to refer to the C# 7.0 feature ("ref locals and returns").

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not published. It's in #3667

Good point on the link. I'll update it in the other PR once I have reviews on it.

@jcouv
Copy link
Member

jcouv commented Nov 14, 2017

LGTM Thanks
Tagging @jaredpar @MadsTorgersen

Copy link
Contributor

@rpetrusha rpetrusha left a comment

Choose a reason for hiding this comment

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

A number of comments and suggestions, @BillWagner.

One theme for this release is working more efficiently with value types by
avoiding unnecessary copies or allocations.

The remaining features are small, nice to have features.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: nice to have --> nice-to-have

* [Non-trailing named arguments](#non-trailing-named-arguments)
- Named arguments can be followed by positional arguments.
* [Leading underscores in numeric literals](#leading-underscores-in-numeric-literals)
- Number literals can now have leading underscores before any printed digits.
Copy link
Contributor

Choose a reason for hiding this comment

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

Number --> Numeric

## Reference semantics with value types

Language features introduced in 7.2 enable scenarios
for working with value types while using reference semantics. These features
Copy link
Contributor

Choose a reason for hiding this comment

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

This first sentence is difficult to parse. Perhaps:
enable scenarios for working with value types --> let you work with value types
These features --> They


Language features introduced in 7.2 enable scenarios
for working with value types while using reference semantics. These features
are designed to increase performance by minimize copying value types without
Copy link
Contributor

Choose a reason for hiding this comment

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

minimize --> minimizing

incurring the memory allocations associated with using reference types. The
features include:

- The `in` modifier on parameters to specify that an argument is passed by reference, but not modified by the called method.
Copy link
Contributor

Choose a reason for hiding this comment

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

These four features should be parallel in structure. I personally like the format of the first one (, to , So my comments will assume all four will follow that format, but you could also make the in modifier conform to the other three.
comma after parameters, and no comma before but


## Leading underscores in numeric literals

The first implementation of allowing `_` characters in numeric literals did not allow the
Copy link
Contributor

Choose a reason for hiding this comment

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

"of allowing _ characters in numeric literals" is not a good description. I'd change it to "The first implementation of support for digit separators in numeric literals...". Or mention 7.0 -- "The implementation of support for digit separators in C# 7.0 did not allow..."

## Leading underscores in numeric literals

The first implementation of allowing `_` characters in numeric literals did not allow the
`_` to be the first character of the literal value. Numeric
Copy link
Contributor

Choose a reason for hiding this comment

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

Not all numeric literals, but only binary and hex, no?


## `private protected`

Finally, a new compound access modifier: `private protected`, indicates that a member may be
Copy link
Contributor

Choose a reason for hiding this comment

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

if you keep the colon, no comma after private protected. If you keep the comma after private protected, change the colon to a comma.

## `private protected`

Finally, a new compound access modifier: `private protected`, indicates that a member may be
accessed by derived classes that are declared in the same assembly. Where `protected internal`
Copy link
Contributor

Choose a reason for hiding this comment

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

Where --> While


Finally, a new compound access modifier: `private protected`, indicates that a member may be
accessed by derived classes that are declared in the same assembly. Where `protected internal`
access allows access by derived classes or classes that are in the same assembly, `private protected`
Copy link
Contributor

Choose a reason for hiding this comment

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

The first occurrence of "access" here can be deleted.

Copy link
Contributor

@mairaw mairaw left a comment

Choose a reason for hiding this comment

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

LGTM. Some minor comments in addition to the ones already made by @rpetrusha


## Leading underscores in numeric literals

The first implementation of allowing `_` characters in numeric literals did not allow the
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @rpetrusha. Also use contractions: did not allow -> didn't allow

features include:

- The `in` modifier on parameters to specify that an argument is passed by reference, but not modified by the called method.
- The `ref readonly` modifier on method returns indicates that a method returns its value by reference but does not allow writes to that object.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: does not -> doesn't

## Non-trailing named arguments

Method calls may now use named arguments that precede positional arguments when those
named arguments are in the correct positions. Read more in the updated content for
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably stick with the boilerplate sentence here. For more information, see ...

access allows access by derived classes or classes that are in the same assembly, `private protected`
limits access to derived types declared in the same assembly.

You can read more of the details in the language reference article on [access modifiers](../language-reference/keywords/access-modifiers.md).
Copy link
Contributor

Choose a reason for hiding this comment

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

again I'd probably stick with the boilerplate here.

@BillWagner
Copy link
Member Author

Updated based on feedback. @mairaw @rpetrusha Can you take a look?

@rpetrusha
Copy link
Contributor

LGTM, @BillWagner. The build is still in progress, but you can merge once the build finishes and it looks good.

@BillWagner
Copy link
Member Author

Closing and reopening to force a build (to check a link)

@BillWagner BillWagner closed this Nov 15, 2017
@BillWagner BillWagner reopened this Nov 15, 2017
@BillWagner BillWagner merged commit 1278d21 into dotnet:master Nov 15, 2017
@BillWagner BillWagner deleted the whats-new-7-2 branch November 16, 2017 18:51
JRAlexander pushed a commit to JRAlexander/docs that referenced this pull request Nov 20, 2017
* add what's new in 7.2

* prrofread and update

* respond to feedback.

* update referenced file name
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.

4 participants