Docs: Prefer closely matching explicit spec AO names

This commit is contained in:
sideshowbarker 2025-02-25 14:24:52 +09:00 committed by Sam Atkins
commit 18a160e0e9
Notes: github-actions[bot] 2025-02-27 07:41:19 +00:00

View file

@ -35,6 +35,22 @@ class Filedescriptor;
String MIME_Type(); String MIME_Type();
``` ```
When implementing spec algorithms and other constructs that a spec explicitly names, prefer closely matching the same names the spec uses, whenever possible.
Given the construct at https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#suffering-from-being-missing which has the literal name _“Suffering from being missing”_ in the spec, for example:
###### Right:
```c++
bool HTMLInputElement::suffering_from_being_missing(); // exactly matches the spec naming
```
###### Wrong:
```c++
bool HTMLInputElement::has_missing_constraint(); // arbitrarily differs from spec naming
```
Use full words, except in the rare case where an abbreviation would be more canonical and easier to understand. Use full words, except in the rare case where an abbreviation would be more canonical and easier to understand.
###### Right: ###### Right: