This page describes the rules for documenting the members and parameters of an API element. Every public element of an API gets its own section and its own description, and some element types need specific facts in that description. Member rules carry the api-member prefix, and parameter rules keep api-param. Return values and errors have their own pages.
Provide a description for every public class, interface, struct, constant, field, enum, typedef, method, parameter, return value, and exception in the API reference documentation. Give every public member its own section, and never omit a member because its description isn’t written yet.
Examples
- ✓
timeout (number): Maximum time in milliseconds to wait for a response.
- ✗
timeout (number):
Rationale
An undocumented member leaves the reader to guess what it does or to read the source code. A description for every member keeps the API reference documentation complete.
In a list of members of one element type (a Methods or Properties section), head each member’s section with the identifier alone, as it appears in code. For a method or function, the identifier is the name followed by its parameter names in parentheses. Give each overload its own section. When a member has its own page, the page title is the identifier followed by its element type (assert() method, RetryPolicy class). The identifier keeps its code casing in either place; sentence case (cap-001) doesn’t apply to an identifier, and the heading takes no code font (head-011).
Examples
- ✓ ## open(path)
- ✓ ## open(path, mode)
- ✗ ## The open method (in a Methods section, the element type is the section’s, not the member’s)
- ✗ ##
open(path, mode)
- ✗ ## Open(path, mode) (casing changed to fit sentence case)
- ✓ # assert() method (the member’s own page)
- ✓ # RetryPolicy class (the class’s own page)
- ✗ # assert() (the member’s own page, where nothing states the element type)
Rationale
A member heading is the member’s name, which is what a reader searches for, what the page’s table of contents shows, and what the anchor is built from. Changing its casing or wrapping it in code font breaks the match between the heading and the code. In a list, the section heading already names the element type, so repeating the element type on every member adds nothing. On a member’s own page, the title is the only place that states the element type.
Use specific verb starters for method descriptions based on method type. The starters are Checks whether for boolean getter methods, Gets the for other getter methods, Returns the for a method that computes or looks up a value and is not a getter, Sets the for setter methods, Creates a for constructor convenience methods, and Called by for callbacks. In a language whose convention describes a property through its accessors, the property description also uses Gets the, Sets the, or Gets or sets the. In other languages, a property, field, or constant description starts with a noun phrase (api-member-011).
Examples
- ✓
isEnabled(): Checks whether the feature flag is on.
- ✗
isEnabled(): Gets the feature flag state.
- ✓
findByEmail(email): Returns the user with the specified email address.
Rationale
Consistent opening verbs let a reader recognize a method’s type, such as getter, setter, or callback, at a glance.
Start the description of a data member, such as a property, field, constant, or enum value, with a noun phrase that states what the value is. Include the unit, range, or default when the reader needs it to use the value. In a language whose convention describes a property through its accessors, as Gets the or Gets or sets the, follow that convention and api-member-003 instead. Use one form for all the properties in an API.
Examples
- ✓
avatarHeight: The height of the player avatar in the world, in meters.
- ✓
AvatarHeight (C#): Gets or sets the height of the player avatar in the world, in meters. (The language’s accessor convention, which follows api-member-003.)
- ✗
avatarHeight: Stores the avatar’s height.
- ✓
MAX_RETRIES: The maximum number of retry attempts before a request fails.
- ✓
Pending (enum value): A job that is queued and has not started.
- ✗
Pending (enum value): Indicates that the job is queued.
Rationale
A property, field, constant, or enum value is a value, not an action, so a noun phrase describes the value directly. Some languages document a property through its accessors, and readers of those languages expect the Gets or sets form, which api-member-003 covers. In either form, a reader in a members list is looking for what the value is, and a verb such as Stores or Indicates describes how the member works instead of what the value is.
In a member description, use the definite article for values the reader can identify from the member’s own entry, including its parameters and the element the member belongs to. Use the indefinite article only for an object the member creates or for a value that isn’t specific.
Examples
- ✓ Increments the number by the multiplier.
- ✗ Increments a number by a multiplier.
- ✓ Creates a session for the current user.
- ✓ Returns a random element from the list.
Rationale
An entry’s signature and parameter documentation identify its values, so the definite article points at them correctly. The indefinite article means “any one of these.” That meaning is wrong for a value the caller already holds, and right only for something the member creates or leaves unspecified.
Don’t use a parameter name as a noun in a member description. Name the concept in plain English and leave parameter names to the parameter documentation. Where a description does refer to a parameter as an API element, follow the name with parameter.
Examples
- ✓ Increments the number by the multiplier.
- ✗ Increments
number by multiplier.
- ✓ The
mode parameter controls whether the file opens for reading or for writing.
- ✗
mode controls whether the file opens for reading or for writing.
Rationale
Member descriptions appear without their signatures in search results, summary tables, and editor tooltips, so a description built from parameter names loses the context that explains the names. A bare code-font name in a sentence can also be taken for a literal value or for the identifier itself, not for the value that the caller supplies. Readers scan member descriptions before, and often instead of, parameter descriptions.
When a member description refers to two elements of the same type, distinguish them with current for the element the member belongs to or the element in scope, and specified for an element or value the caller supplies. Don’t add current or specified when the description refers to only one element of that type. Don’t use this for the element the member belongs to, and don’t substitute given, provided, supplied, passed-in, or input for specified.
Examples
- ✓ Copies the instance ID of the specified
Servo instance to the current Servo instance.
- ✗ Copies the ID of the given servo to this servo.
- ✓ Returns the instance ID of the current
Servo instance. (Another instance is in scope.)
- ✓ Returns the instance ID of the
Servo instance. (No other instance is involved.)
- ✗ Returns the instance ID of this
Servo instance.
- ✗ Increments the specified number by the specified multiplier.
Rationale
Current and specified distinguish the element the member belongs to from the one the caller supplies, without relying on a language keyword, and a qualifier used where nothing contrasts weakens the pair. This is a keyword in most object-oriented languages, and the English word can’t be marked as code, so the reader can’t tell which is meant. That is true even when this Servo instance has a clear antecedent, which is why the rule is narrower than sentence-001. Given, provided, and supplied don’t indicate who supplied the value, because an API supplies values to the caller as often as the caller supplies them, and input has its own meaning in streams, forms, and machine learning.
When a member description refers to an identifier, name the identifier type and what it identifies. Don’t use a bare ID where the reader could take it as identifying either the code element or the real-world entity that element represents. A description that already names what the identifier identifies needs nothing more.
Examples
- ✓ Returns the instance ID of the current
Servo instance.
- ✓ Returns the hardware ID of the servo that the current
Servo instance controls.
- ✗ Returns the ID of the servo.
- ✗ Returns the ID of the current
Servo instance.
- ✓
id: The identifier the beacon advertises. (The description names what the ID identifies; nothing more is needed.)
Rationale
In component, entity, and device APIs, a bare ID more often identifies the entity, device, or record than the object that holds it, so an unqualified ID leaves the reader to guess which one a member returns. Naming the identifier type also tells the reader what scope the value is unique in.
Document any dependencies that a method needs before it can be called, such as required permissions or platform requirements, and describe the method’s behavior when those dependencies are absent. When your reference format lists dependencies in a table or a section of their own and the resulting error in the errors section, the description doesn’t need to repeat them. Document in the description only what those sections don’t cover, such as a permission that the user must enable in a setting.
Examples
- ✓ Requires the
contacts.read permission. Without it, the call throws a PermissionError exception.
- ✗ Reads the user’s contacts.
Rationale
A method that needs a permission or a platform fails without it, and the failure doesn’t always explain why. When the description states the dependency and what happens without it, the caller doesn’t have to debug the failure to find the cause.
For boolean parameters and properties, describe what happens when the value is true and when it is false. If either description is long, use a separate sentence for each value. Write the literals in code font, spelled as the language spells them (true, True, TRUE). A sentence can open with a lowercase literal in code font; if your group prefers not to, write around it by opening with If or Returns. When true and false are ordinary words rather than the values (a true copy), don’t use code font.
Examples
- ✓
recursive: If true, deletes subdirectories too; if false, deletes only files in the top-level directory.
- ✗
recursive: Whether the delete is recursive.
- ✓
retryOnTimeout (property): true to retry a request that times out; false to fail it on the first timeout.
- ✓
strict: If true, the parser rejects any input that does not match the schema and reports the first mismatch. If false, the parser accepts the input, fills missing fields with their defaults, and records each mismatch as a warning.
- ✓
verbose (Python): True to log every request; False to log errors only.
Rationale
A boolean’s name doesn’t always indicate what each value does, so the description states both and the reader doesn’t have to guess. Code font marks true as the value that the caller passes, so it uses the language’s own spelling. The word true in ordinary text stays a word.
For parameters with default values, document the default explicitly using a “Default:” label.
Examples
- ✓
limit: Maximum number of results to return. Default: 20.
- ✗
limit: Maximum number of results to return.
Rationale
A caller needs the default to know what happens when they omit the parameter.
Mark input parameters, output parameters, and parameters that are both with the language’s or the API’s own syntax (out, ref, inout, a pointer, a returned tuple). In the parameter description, describe the value; don’t restate the direction. Later text can note that a parameter is an output parameter when the reader needs it, for example when the caller must pass an initialized variable.
Examples
- ✓
out count (int): The number of records that matched the filter.
- ✗
count (int): Output parameter. Receives the number of records that matched the filter.
Rationale
A parameter’s direction is part of the signature, and the language already has a notation for it that readers of that language recognize. A description that repeats the direction in words has less room to explain what the value means.
Use parameter for the variable named in a method’s definition and argument for the actual value passed to it in a call; don’t use the two terms interchangeably.
Examples
- ✓ The
timeout parameter accepts an integer; pass 30 as the argument.
- ✗ The
timeout argument accepts an integer; pass 30 as the parameter.
Rationale
A parameter is the variable that the method declares, and an argument is the value that the caller passes at the call site. When a description mixes up the two terms, the reader can’t tell whether it refers to the declaration or to the value they control.
The five member-level rules on this page were re-issued under the api-member
prefix on 2026-09-09: api-param named a subset of what they cover, because
parameters exist only on methods and functions, which are themselves member
types. Two of them moved again on 2026-09-15, to the page a reader looks at
first. The retired IDs stay reserved and are never reused.
api-param-001 (retired 2026-09-09): “Describe every public member.” Re-issued as api-member-001, unchanged.
api-param-002 (retired 2026-09-09): “Lead with the purpose.” Re-issued as api-member-002, unchanged; see that entry.
api-param-003 (retired 2026-09-09): “Match the verb to the method type.” Re-issued as api-member-003, unchanged.
api-param-006 (retired 2026-09-09): “Code font and links for API names.” Re-issued as api-member-004, unchanged; see that entry.
api-param-007 (retired 2026-09-09): “Document dependencies and their absence.” Re-issued as api-member-005, unchanged.
api-member-002 (retired 2026-09-15): “Lead with the purpose.” Folded into api-intro-002, which also bans naming the element type.
api-member-004 (retired 2026-09-15): “Code font and links for API names.” Re-issued as api-ref-004, which adds when to link and when not to.