Re: [heycam/webidl] Sort out when dictionaries and records should have default values (#76)

> I pointed out that the syntax itself is counter intuitive.

Which particular syntax?

> Having things labeled optional which are effectively required, seem like semantic footguns

That seems like a fair criticism.  When we added "required", we allowed making dictionaries with a required member non-optional arguments even in trailing position.  Maybe we should just disallow them from being marked optional, period, because that's never a sensible thing to do.  That seems tangential to the issue at hand, though.

> It's also not to spec

What spec, exactly?

> as an "actual JS developer"

My point was that if we're trying to figure out what a "good" JS API is, the right way to do that is to examine APIs designed by people who write JS all the time for use by other people who write JS all the time.  I'm not quite sure what you're asking here...

> What about records?

Again, conceptually, an empty record and a missing record mean the same thing: empty list of stuff.  What would be a use case where you'd want to tell apart the two cases?  That case seems a lot more clear-cut than the dictionary case, because there is no equivalent of `required`, right?

I keep thinking that adding `required` to dictionaries was a mistake.  :(

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/76#issuecomment-394133331

Received on Sunday, 3 June 2018 04:01:25 UTC