Skip to content

Style: Consider allowing and, or, and not keywords in C++ code #399

@arcondello

Description

@arcondello

C++ supports and, or, not keywords. not especially seems much more readable to me in if-clauses

if (not std::is_sorted(range)) {}

vs

if (!std::is_sorted(range)) {}

Currently we don't use them anywhere in the code base, mostly because the Google C++ style guide disallows them

Also note that you should always use the punctuation operators, such as && and ~, rather than the word operators, such as and and compl.

But IMO we should diverge for readability. Though this is coming from someone who was raised on Python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested or further design needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions