Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New principle: Patterns for x() vs xSync() #402

Closed
cynthia opened this issue Nov 1, 2022 · 5 comments · Fixed by #417
Closed

New principle: Patterns for x() vs xSync() #402

cynthia opened this issue Nov 1, 2022 · 5 comments · Fixed by #417
Assignees
Labels
Agenda+ Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project)

Comments

@cynthia
Copy link
Member

cynthia commented Nov 1, 2022

This was brought up in our discussion of w3ctag/design-reviews#771.

TL:DR; we don't have guidance on what to do when an API wants to be synchronous, and the very small subset of cases where this is valid (for the time being).

@cynthia cynthia self-assigned this Nov 1, 2022
@LeaVerou
Copy link
Member

LeaVerou commented Nov 1, 2022

I think both naming schemes are useful in different cases, basically x() should be the common case and xSync()/xAsync() the exception. I.e. if the main usage is sync, then x() and xAsync() seems preferable. If the main usage is async, then x() and xSync() seems preferable.

@anssiko
Copy link

anssiko commented Nov 3, 2022

@LeaVerou @cynthia, thank you for considering this and for sharing your guidance on this naming pattern issue. I will bring the above principle back to the WG without blocking on the corresponding Web Platform Design Principles doc update.

@LeaVerou
Copy link
Member

LeaVerou commented Nov 3, 2022

I think both naming schemes are useful in different cases, basically x() should be the common case and xSync()/xAsync() the exception. I.e. if the main usage is sync, then x() and xAsync() seems preferable. If the main usage is async, then x() and xSync() seems preferable.

Note that sometimes the common case and the case you want to encourage may be different.

@LeaVerou @cynthia, thank you for considering this and for sharing your guidance on this naming pattern issue. I will bring the above principle back to the WG without blocking on the corresponding Web Platform Design Principles doc update.

Might be a good idea to wait for us to at least discuss, as right now that's just my personal opinion and not TAG consensus. We can add it to the agenda for next week, so you'd only need to wait a few days.

@anssiko
Copy link

anssiko commented Nov 3, 2022

@LeaVerou your personal opinion was well received in the WG and helped us reach consensus. That said, we’ll track this issue for any further guidance. For now, we settled on x() and xSync() for this API in question.

@plinss plinss added this to the 2022-11-07-week milestone Nov 7, 2022
@torgo torgo added the Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project) label Nov 8, 2022
@torgo
Copy link
Member

torgo commented Nov 8, 2022

We discussed today and agreed to write a temporary principle.

@torgo torgo modified the milestones: 2022-11-07-week, 2022-12-05-week Dec 4, 2022
cynthia added a commit that referenced this issue Feb 8, 2023
cynthia added a commit that referenced this issue Feb 9, 2023
* Add new principle for sync() vs async().

Resolves #402.

* Update index.bs

Co-authored-by: Lea Verou <[email protected]>

* Update index.bs

Co-authored-by: Lea Verou <[email protected]>

* Update index.bs

Co-authored-by: Lea Verou <[email protected]>

* Update index.bs

Co-authored-by: Peter Linss <[email protected]>

* Update index.bs

* Update index.bs

* Update index.bs

* Update index.bs

* Apply suggestions from code review

---------

Co-authored-by: Lea Verou <[email protected]>
Co-authored-by: Peter Linss <[email protected]>
hober pushed a commit that referenced this issue Apr 20, 2023
* Add new principle for sync() vs async().

Resolves #402.

* Update index.bs

Co-authored-by: Lea Verou <[email protected]>

* Update index.bs

Co-authored-by: Lea Verou <[email protected]>

* Update index.bs

Co-authored-by: Lea Verou <[email protected]>

* Update index.bs

Co-authored-by: Peter Linss <[email protected]>

* Update index.bs

* Update index.bs

* Update index.bs

* Update index.bs

* Apply suggestions from code review

---------

Co-authored-by: Lea Verou <[email protected]>
Co-authored-by: Peter Linss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agenda+ Status: Consensus to write We have TAG consensus about the principle but someone needs to write it (see "To Write" project)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants