Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[String] renamed core classes to Byte/CodePoint/UnicodeString #33816

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 1 commit into from
Oct 7, 2019

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Oct 2, 2019

Q A
Branch? master
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

In #33553 there have been discussions about the naming of the classes - eg. "what's a grapheme", "why Utf8String", "lowercase on binary is weird", etc.

What about these names? Would they get your votes vs the current ones?

  • BinaryString -> ByteString
  • Utf8String -> CodePointString
  • GraphemeString -> UnicodeString

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

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

I like the new names a lot: ByteString and UnicodeString would be self-explanatory for most developers and only CodePointString would need some explanation for some people (but that's normal ... this is a "complex" topic, so developers need to learn some terminology).

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

I like the new naming. In the original PR, I especially found the name BinaryString problematic. If we look at the operations that this class allows, the class does not represent an arbitrary binary string, but a character string with some one-byte character encoding, e.g. ISO-8859-something. The new name reflects that better, imho.

nicolas-grekas added a commit that referenced this pull request Oct 7, 2019
…tring (nicolas-grekas)

This PR was merged into the 5.0-dev branch.

Discussion
----------

[String] renamed core classes to Byte/CodePoint/UnicodeString

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

In #33553 there have been discussions about the naming of the classes - eg. "what's a grapheme", "why `Utf8String`", "lowercase on binary is weird", etc.

What about these names? Would they get your votes *vs* the current ones?
- `BinaryString` -> `ByteString`
- `Utf8String` -> `CodePointString`
- `GraphemeString` -> `UnicodeString`

Commits
-------

63c105d [String] renamed core classes to Byte/CodePoint/UnicodeString
@nicolas-grekas nicolas-grekas merged commit 63c105d into symfony:master Oct 7, 2019
@nicolas-grekas nicolas-grekas deleted the string-uni branch October 7, 2019 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants