Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Naming things #19

Open
Open
@ruuda

Description

@ruuda

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 namedUnicodeNormalize instead, or perhaps evenNormalize, to avoid repeating the module name.
  • The method namesnfd,nfkd,nfc, andnfkc have no intrinsic meaning, which makes it hard to know what they do in isolation, outside of the context of theUnicodeNormalization docs. Even for a person who is aware of the concept of Unicode normalization, it might not be clear what a line likelet c = s.nfc().collect::<String>(); does, without first having seen the documentation, or an explanatory comment. Something likenormalize_form_c would at least suggest that some kind of normalization is going on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp