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

Avoid using ambiguous terminology in str.h/str.c #159

Open
wants to merge 2 commits into
base: master
from

Conversation

@le-jzr
Copy link
Contributor

@le-jzr le-jzr commented Feb 5, 2019

Instead of ambiguous terms "size", "length", and "characters", use unambiguous terms "bytes" and "code points", including in function names.

Function name changes:
(w)str_(ln)size -> (w)str_(ln)bytes
(w)str_(n)length -> (w)str_(n)code_points

The purpose of this change is to avoid confusing the purpose of those functions, especially given the conflicting terminology of standard strlen, and the nonexistence of the term "character" in Unicode (there we have code units, code points, and grapheme clusters, only the last of which actually being what's colloquially understood as a character).

le-jzr added 2 commits Feb 5, 2019
This and the following commit change the names of functions, as well as
their documentation, to use unambiguous terms "bytes" and "code points"
instead of ambiguous terms "size", "length", and "characters".
@le-jzr le-jzr requested review from jermar and jxsvoboda Feb 5, 2019
@le-jzr
Copy link
Contributor Author

@le-jzr le-jzr commented Feb 11, 2019

@jermar, @jxsvoboda Any comments?

@jermar
Copy link
Member

@jermar jermar commented Feb 11, 2019

Hm, I don't feel knowledgeable enough, so whatever you and @jxsvoboda deem proper.

@jxsvoboda
Copy link
Contributor

@jxsvoboda jxsvoboda commented May 17, 2020

I understand where you are coming from, but you will notice the cunning correspondence between the 'l' prefix and the 'length' suffix (although not for n vs size which gets lost with your change. Also _code_points is wordier than _length. Overall I am not convinced this change is for the better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.