w3ctag / design-principles

A small-but-growing set of design principles collected by the TAG while reviewing specifications
https://w3ctag.github.io/design-principles
176 stars 46 forks source link

Use of "attribute" confusing/ambiguous #457

Closed jakearchibald closed 3 months ago

jakearchibald commented 10 months ago

https://w3ctag.github.io/design-principles/#attribute-reuse - in this section, 'attribute' means DOM attribute

https://w3ctag.github.io/design-principles/#attributes-vs-methods - in this section, 'attribute' mean IDL attribute.

It feels like this could be less confusing somehow.

LeaVerou commented 8 months ago

Two ways forward here:

  1. Be explicit each time and use "DOM attribute" or "IDL attribute" everywhere.
  2. Use "attribute" to mean "DOM attribute" and JS-centric terms ("property" or "accessor" depending on the case) to refer to IDL attributes ( basically what https://github.com/w3ctag/design-principles/pull/435 was trying to do)

@hober has expressed a strong preference for 1 and strong opposition to 2, so it may be the path of least resistance to just go with 1 which at least resolves the inconsistency.

bkardell commented 8 months ago

I think I agree with a preference for 1. If you look for example at all of the text in https://w3ctag.github.io/design-principles/#attributes-vs-methods - it really seems clearer.

plinss commented 6 months ago

Discussed in breakout and agreed to use option 1. @hober to write a PR.

martinthomson commented 6 months ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects uses the word "property". I understand that IDL uses "attribute", but we aren't really talking about IDL as much as we are talking about the objects that are described using IDL.

"Use attributes or methods appropriately" -> "Properties and getters should behave like properties not methods".