Skip to content

Conversation

@srutzky
Copy link
Contributor

@srutzky srutzky commented Jul 9, 2019

Make Unicode escapes more consistent with recent improvements made to https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/strings :

  1. Moved \v row up to be just under \t. This move provides for a more logical grouping of the escape sequences: simple, static ones first, followed by the dynamic Unicode escape sequences that require a user-supplied value. I think having this grouping will make the list more readable for most readers, which I feel is more important than maintaining strict alphabetical ordering of the list. The \v just seemed out of place between \u and \x, and if someone is looking for a Unicode escape sequence, I believe it helps to have those all together.

  2. Switched order of \u and \U so that \u could come first as that, again, seems to flow better / be a more logical progression.

  3. Changed character used for hex digit placeholder in escape sequence from n to H, as again, I feel it is more readable / more intuitive that "H" refers to "Hex" whereas "n" is ambiguous as "number"? And, it has more visual clarity since the lower-case "n" blends in a bit with "u" (at least to me it does).

  4. Added range for all user-supplied values (why make readers hunt elsewhere for that info, especially when \U is not as obvious as the other two?).

  5. Added generic format for \x

  6. Change example code point / character for \u and \x to something a little more interesting than "A" :-)

  7. Added missing example permutation of \x

For more details, please visit: https://bit.ly/UnicodeEscapeSequences

Make Unicode escapes more consistent with recent improvements made to https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/strings

1.  Moved `\v` row up to be just under `\t`. This move provides for a more logical grouping of the escape sequences: simple, static ones first, followed by the dynamic Unicode escape sequences that require a user-supplied value. I think having this grouping will make the list more readable for most readers, which I feel is more important than maintaining strict alphabetical ordering of the list. The `\v` just seemed out of place between `\u` and `\x`, and if someone is looking for a Unicode escape sequence, I believe it helps to have those all together.

2. Switched order of `\u` and `\U` so that `\u` could come first as that, again, seems to flow better / be a more logical progression.

3. Changed character used for hex digit placeholder in escape sequence from `n` to `H`, as again, I feel it is more readable / more intuitive that "H" refers to "Hex" whereas "n" is ambiguous as "number"? And, it has more visual clarity since the lower-case "n" blends in a bit with "u" (at least to me it does).

4. Added range for all user-supplied values (why make readers hunt elsewhere for that info, especially when `\U` is not as obvious as the other two?).

5. Added generic format for `\x`

6. Change example code point / character for `\u` and `\x` to something a little more interesting than "A" :-)

7. Added missing example permutation of `\x`

For more details, please visit: https://bit.ly/UnicodeEscapeSequences
@srutzky srutzky requested a review from BillWagner as a code owner July 9, 2019 17:54
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 continuing to make these improvements @srutzky We appreciate it.

I’ve reviewed the changes, and I’ll :shipit: now.

Thanks again.

@BillWagner BillWagner merged commit 26b60e5 into dotnet:master Jul 10, 2019
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.

2 participants