What is the issue with the Web IDL Standard?
The WebIDL spec currently gives this advice for specification authors:
Note that specifying dictionary members as required only has an observable effect when converting other representations of dictionaries (like a JavaScript value supplied as an argument to an operation) to an IDL dictionary. Specification authors should leave the members optional in all other cases, including when a dictionary type is used solely as the return type of operations.
I think think this advice should be reconsidered, as even in the case of dictionary that is used solely as a return type, it can be useful for clients of the dictionary (authors writing web pages) to know which members of the dictionary will always be present, without having to delve into the prose. This allows them to avoid things like unnecessary undefined checks.
It also has a nice side benefit of allowing engines to optimize their internal representations more easily.
What is the issue with the Web IDL Standard?
The WebIDL spec currently gives this advice for specification authors:
I think think this advice should be reconsidered, as even in the case of dictionary that is used solely as a return type, it can be useful for clients of the dictionary (authors writing web pages) to know which members of the dictionary will always be present, without having to delve into the prose. This allows them to avoid things like unnecessary undefined checks.
It also has a nice side benefit of allowing engines to optimize their internal representations more easily.