Skip to content

Commit

Permalink
Default values should be the common choice (#522)
Browse files Browse the repository at this point in the history
Closes #391.

Co-authored-by: Peter Linss <[email protected]>
  • Loading branch information
martinthomson and plinss authored Dec 4, 2024
1 parent 5455001 commit 2a60543
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,13 @@ This is for legacy interoperability reasons,
not as an example of good design.
</div>

The default value should be the value
that most authors will choose,
if that choice is obvious.
For boolean attributes,
that might mean that the attribute name
needs to be chosen so that `false` is the common choice.

When deciding between different list data types for your API,
unless otherwise required, use the following list types:

Expand All @@ -1651,6 +1658,7 @@ unless otherwise required, use the following list types:
See also:

* [[#prefer-dictionaries]]
* [[#naming-optional-parameters]]
* <a href="https://lists.w3.org/Archives/Public/public-script-coord/2013OctDec/0302.html">APIs that have boolean arguments defaulting to true</a>

<h3 id="naming-optional-parameters">Name optional arguments appropriately</h3>
Expand Down

0 comments on commit 2a60543

Please sign in to comment.