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

Naming things #19

Open
ruuda opened this issue Nov 4, 2017 · 1 comment
Open

Naming things #19

ruuda opened this issue Nov 4, 2017 · 1 comment

Comments

@ruuda
Copy link

ruuda commented Nov 4, 2017

Apologies for the bikeshed, but I have a few comments about the API that might be worth considering before a 1.0 release:

  • When a trait represents an action, it is generally named imperatively (Display, Read, Write, Hash, etc.). For least surprise, UnicodeNormalization could be named UnicodeNormalize instead, or perhaps even Normalize, to avoid repeating the module name.
  • The method names nfd, nfkd, nfc, and nfkc have no intrinsic meaning, which makes it hard to know what they do in isolation, outside of the context of the UnicodeNormalization docs. Even for a person who is aware of the concept of Unicode normalization, it might not be clear what a line like let c = s.nfc().collect::<String>(); does, without first having seen the documentation, or an explanatory comment. Something like normalize_form_c would at least suggest that some kind of normalization is going on.
@tesuji
Copy link

tesuji commented Feb 2, 2019

@ruuda I think method names is consistent with http://unicode.org/reports/tr15/#Normalization_Forms_Table.

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

No branches or pull requests

2 participants