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

nonX vs. non-X and similar hyphenation issues #440

Open
jwakely opened this issue Feb 13, 2015 · 13 comments
Open

nonX vs. non-X and similar hyphenation issues #440

jwakely opened this issue Feb 13, 2015 · 13 comments
Assignees

Comments

@jwakely
Copy link
Member

jwakely commented Feb 13, 2015

The standard is inconsistent about using "nonzero" and "non-zero"

@jensmaurer
Copy link
Member

jensmaurer commented Nov 13, 2016

We're inconsistent about most any combination involving "non". For example, "non-class" appears 18 times and "nonclass" appears 3 times.

Richard, it seems British English prefers the hyphen and US English doesn't. It seems going for "non-whatever" requires fewer changes and often improves readability by highlighting the "non".

Your decision?

@jlaire
Copy link

jlaire commented Nov 13, 2016

List of words appearing without hyphen: nonabstract (1-1), nonclass (3-18), nonconst (1-31), nonconstant (5-9), nondeterministic (2-9), nonempty (5-14), nongraphic (1-0), nonmember (5-53), nonportable (1-2), nontrivial (1-30), nonzero (27-19).

"nonzero" does appear more often than "non-zero", but otherwise hyphens are much more common.

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Nov 13, 2016
@jensmaurer
Copy link
Member

subexpression (37-38)

@zygoloid
Copy link
Member

I don't think a blanket rule for "nonX" vs "non-X" is the right way to go; some "nonX" words are sufficiently common that "non-X" would be a strange choice. Conversely, for terms that we made up, I agree that including the hyphen improves readability, and makes it clearer that the term following the hyphen is indeed our defined term. (I don't want definitions such as "A non-trivial class is a class that is not trivial.")

My current thinking is:

  • For technical terms defined by the C++ standard, where "nonX" is either not an English word or not one with the right meaning, use a hyphen: non-abstract, non-class, non-const, non-constant, non-empty (when referring to empty classes), non-member, non-trivial (when referring to special member triviality)
  • For plain English words where the "nonX" form is well-established (when the closed form is listed in a common dictionary), do not use a hyphen: nondeterministic, nonempty (when referring to sets), nontrivial (when referring to the difficulty of doing something), and nonzero.
  • For plain English words where the "nonX" form is not established, use a hyphen: non-graphic, non-portable.

@zygoloid
Copy link
Member

"Subexpression" should not be hyphenated. (And we should add a definition of it, probably in terms of "immediate subexpression".)

@jlaire
Copy link

jlaire commented Nov 23, 2016

There are also 4 instances of "sub-object" and 5 of "sub-sequence".

Edit: "floating-point" vs. "floating point" looks inconsistent as well.

@zygoloid
Copy link
Member

"Subobject" should not be hyphenated. It's defined without a hyphen in [intro.object]/2.

@jensmaurer jensmaurer changed the title nonzero vs non-zero nonX vs. non-X and similar hyphenation issues Nov 23, 2016
@jensmaurer
Copy link
Member

"floating-point vs. floating point" should use the regular English adjective hyphenation rules, i.e. "floating-point type" (adjective, needs hyphen) vs. "the value has a floating point" (adjective plus noun, no hyphen).

@jensmaurer jensmaurer self-assigned this Nov 23, 2016
@jensmaurer jensmaurer removed the decision-required A decision of the editorial group (or the Project Editor) is required. label Nov 23, 2016
@jlaire
Copy link

jlaire commented Nov 23, 2016

None of the uses seem to be of the adjective plus noun kind like your example. IEEE-754-2008 also does not have a single occurrence of "floating point" without a hyphen.

@jensmaurer
Copy link
Member

@zygoloid: Just to clarify, it's a "nonempty sequence" and a "nonempty range" and a "nonempty vector", right? (We don't use "non/empty class often; partly because it's an undefined term and the use of "empty" there was subject to a core issue a few years ago.)

@jensmaurer
Copy link
Member

I've added Richard's rules (see bulleted list above) to https://github.com/cplusplus/draft/wiki/Specification-Style-Guidelines .

@FrankHB
Copy link
Contributor

FrankHB commented Mar 8, 2023

Still many nonempty & non-empty in WP, even worse: we have both non-empty range & nonempty range, non-empty sequence & nonempty sequence...

@jensmaurer jensmaurer reopened this Mar 8, 2023
@tkoeppe
Copy link
Contributor

tkoeppe commented Mar 8, 2023

I see 5 instances of "nonempty" -- not exactly ground-shaking, but we can definitely fix this.

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

6 participants