web-platform-dx / web-features

Exploring how to present Web platform features adoptability
https://web-platform-dx.github.io/web-features/
Apache License 2.0
393 stars 75 forks source link

Feature definition guidelines #532

Open foolip opened 10 months ago

foolip commented 10 months ago

We should have detailed guidelines and principles for how to create feature groups in https://github.com/web-platform-dx/web-features/tree/main/docs.

Known discussions:

foolip commented 10 months ago

The main questions to resolve:

captainbrosset commented 10 months ago

At the last WebDX CG meeting, I volunteered to create a shared doc to list the current discussions and questions to resolve. The idea is that, over time, this document would morph into a series of guidelines for how to create groups.

captainbrosset commented 10 months ago

I started unearthing relevant discussions from GitHub and moving them to this shared document: https://docs.google.com/document/d/1Y2hTj9IqgLxOXmlePKttA0muB47DCI5tkeIIevmc18M/edit?usp=sharing

Please add to it if you know of others. Please also comment so we can move this document forward and help it become a set of guidelines we can use going forward.

tidoust commented 10 months ago

Additional questions and conventions that could perhaps be worth addressing in the guidelines:

foolip commented 10 months ago

We need guidelines for the situation in https://github.com/web-platform-dx/web-features/issues/546.

ddbeck commented 9 months ago

I started unearthing relevant discussions from GitHub and moving them to this shared document: https://docs.google.com/document/d/1Y2hTj9IqgLxOXmlePKttA0muB47DCI5tkeIIevmc18M/edit?usp=sharing

Please add to it if you know of others. Please also comment so we can move this document forward and help it become a set of guidelines we can use going forward.

This is great. @captainbrosset has done a bunch of good work here. I was thinking of how to start to get this stuff formalized. I thought a template might help, something along these lines:


## Don't use foo and bar feature descriptions

Metasyntactic variables aren't very memorable. Use real examples.

Incorrect examples:

- ~~The function accepts a string ("foo") and returns a length (3).~~

Correct examples:

- The function accepts a string ("Esperanto") and returns a length (9).

Issues, PRs, and related guidelines

- #10000
- #10001

Then as we get close to consensus, we could fill in the template and open a PR for each guideline. It might also help us break up larger guidelines into smaller ones, to make the reviewing/editing work easier to do.

foolip commented 8 months ago

As I've written a bunch of descriptions and discussed with @ddbeck in PRs, a pattern is emerging, which is "The X does Y" in the active voice. Sometimes I've added a second sentence to gesture at common uses. Descriptions I'm happy with so far:

I've been inconsistent about when "CSS" is used and would like to fix that, generally by removing it.

Descriptions that don't fit this style:

Finally there's "A promise represents an asynchronous operation which eventually succeeds or fails" which is in the active voice but is just "An asynchronous operation which eventually succeeds or fails" with extra fluff.

Now, discuss!

foolip commented 8 months ago

A few observations...

Repeating the name of the feature often helps make clear what it is. The description "The linear() easing function for animations and transitions interpolates linearly between the control points, and can be used to approximate complex easing functions, for example a bounce effect." would be worse as "Interpolates linearly between the control points, and can be used to approximate complex easing functions, for example a bounce effect." This is an extreme case, but I think it's helpful to say "property", "element", etc.

I'm not sure if descriptions need to make sense in isolation, or if we should assume some context in the presentation. In particular, if we can assume that all features grouped as CSS are somehow identified as such when presented, then we can be more comfortable with a description like "The cap unit corresponds to the height of Latin capital letters."

In a few cases, "X is Y" seems more natural than "X does Y", and we probably shouldn't create tortured prose to fit all descriptions into the same format. The WebVTT description seems just fine to me, for example.

ddbeck commented 8 months ago

I was giving some thought to the "X does Y"/"X is Y" and "Does Y" distinction. What would these look like in different contexts? For example, as part of some partly generated feature docs (e.g., like an MDN reference page where there's a title usually immediately followed by some text reiterating the title) or as a tooltip.

I did a bit of poking around to see what high-profile webdev docs are doing (e.g., Tailwind, React, etc.) and a random exploration of code tooltips in my editor.

The main things I learned:

As for "X does Y"/"X is Y" and "Does Y", my conclusion is that it probably doesn't actually matter. That said, I think "X does Y" has a slight edge, given two points:

foolip commented 8 months ago

doesn't actually matter

I think this is a fair summary. Let's write down "X does Y" as our guideline, but with a big "or whatever you like" exception. I think everything will turn out reasonable just through copy-pasting existing descriptions to make new ones.

captainbrosset commented 8 months ago

Because I write technical documentation a fair amount of my time, I do have a few strong opinions about this:

foolip commented 8 months ago

@captainbrosset thank you! It sounds like the descriptions we've written so far mostly aligns with your opinions. Do you think they should be shorter in general though?

ddbeck commented 8 months ago
  • We should keep the description as short as we can to avoid them turning into technical documentation over time. It's highly likely that web-features will be almost always be displayed in conjunction with MDN (or other) docs.

I'd propose starting by setting an arbitrary character limit—we'll probably figure out pretty quickly if we're trying to stuff too much into the description. Maybe a tweetspan, 280 characters?

foolip commented 8 months ago

280 works. The longest we have now is 244.

atopal commented 8 months ago
  • We should keep the description as short as we can to avoid them turning into technical documentation over time. It's highly likely that web-features will be almost always be displayed in conjunction with MDN (or other) docs.

I agree with the point that this should not be turned into technical documentation over time and a character limit seems a good way to achieve that, but I don't think the assumption above will hold (see for example https://caniuse.com/flexbox-gap where this would be a perfect fit). I don't think it changes anything about the guidelines so far, just wanted to state that for possible future guidelines.

foolip commented 8 months ago

https://caniuse.com/flexbox-gap has a very short description, what assumptions do you have in mind there?

atopal commented 8 months ago

That there are no docs to provide context like there is on an MDN page.

foolip commented 8 months ago

So I guess you're saying that description is too short? Maybe we need a minimum description length too? 😆

atopal commented 7 months ago

No, I just linked to that random caniuse.com page to illustrate that there are places where the short descriptions will be used without any other documentation on the page, so we should keep that in mind and never assume that there will be more context for the short description.

foolip commented 7 months ago

Ah. I agree, the descriptions should stand on their own, and only assume the short name is also shown. Most of them would work without the short name too.

ddbeck commented 7 months ago

Description guidelines came up in the WebDX call today. I opened https://github.com/web-platform-dx/web-features/pull/789 to capture as much as I could of the description reviews/edits so far.