docs-community icon indicating copy to clipboard operation
docs-community copied to clipboard

Style guide: boolean or Boolean?

Open hugovk opened this issue 1 year ago • 1 comments

This came up at https://github.com/python/cpython/pull/123845#pullrequestreview-2290598310.

We're not consistent in writing it upper or lower case. A rough search shows it's about 50-50:

❯ rg -s "\bboolean\b" Doc | wc -l
      87

❯ rg -s "\bBoolean\b" Doc | wc -l
      78

Shall we pick something and put it in our style guide?


Looking at some other tech style guides, it's not clear cut.

Google says:

In most contexts, boolean refers to a specific data type in a specific programming language. In such cases, use code font and the exact spelling and capitalization of the programming keyword.

When referring to the abstract data type, use lowercase.

If you refer to Boolean mathematics or Boolean logic, use uppercase.

Microsoft says:

Always capitalize.

Red Hat says:

Boolean. Correct. Named after George Boole, who first developed the concept.

According to the IBM Style Guide, it is acceptable to use "boolean" (lowercase) in API programming information when it refers to a primitive return type.

Apple says:

Boolean (adj.) Note capitalization.

hugovk avatar Sep 10 '24 06:09 hugovk

I like the Google guidance. Capitalizing it all the time seems pedantic and distracting. English is full of eponyms that are not capitalized.

nedbat avatar Sep 10 '24 10:09 nedbat

Please see PR https://github.com/python/devguide/pull/1636.

hugovk avatar Aug 15 '25 09:08 hugovk