Skip to content

API structure conventions: dictionaries #581

Answered by dontcallmedom
Elchi3 asked this question in Content
Discussion options

You must be logged in to vote

I prefer (3) although I suspect there are cases where (2) is more appropriate, e.g.:

  • dictionaries that are re-used in multiple APIs, or inherited from multiple other dictionaries
  • dictionaries whose inline documentation would make the page very long / hard to grok

In other words, I think (3) makes the best default approach, but we should probably leave room for (2) when warranted; I think (1) is an overkill in general.

Another thought: I don't think it's useful for MDN to be talking about "dictionaries" and/or to name them, as in:

This is an EventInit dictionary
https://developer.mozilla.org/en-US/docs/Web/API/Event/Event

From a JS developer perspective, dictionaries aren't a thing; an…

Replies: 0 comments 13 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Elchi3
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jpmedley
Comment options

Comment options

You must be logged in to vote
3 replies
@hamishwillee
Comment options

@foolip
Comment options

@Rumyra
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment