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: name things for what they do, not how they do it #507

Open
martinthomson opened this issue Jul 30, 2024 · 4 comments
Open

Comments

@martinthomson
Copy link
Contributor

This was brought up in our discussion of the Web Translation API.

In that example, the means by which translation is accomplished, AI (or ML), was used as part of the name.

@hober
Copy link
Contributor

hober commented Jul 30, 2024

In the translation case, the fact that the API can be backed by LLMs is an implementation detail. "Do not expose implementation details in naming."

@LeaVerou
Copy link
Member

Big +1 to either formulation.

@domenic
Copy link
Member

domenic commented Sep 10, 2024

I wonder how this design principle would look on existing APIs like navigator.gpu: should it be navigator.graphicsDisplay?

Or even things like "CSS": should it be "style and layout control" instead of talking about the specific mechanisms behind such control?

@martinthomson
Copy link
Contributor Author

navigator.gpu seems to be concretely about graphics processors, though navigator.graphics would be equally fine (graphicsDisplay, in addition to being more verbose, might refer to a monitor).

We already have div.style for a CSS API and <style>, so arguably the principle is already being followed there. Obviously we have a ton of CSSBlah types defined, so it's not perfect, but it's not that bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants