w3c / window-management

Window Management API
https://www.w3.org/TR/window-management/
Other
95 stars 25 forks source link

bikeshed: window.getScreens().screens is an odd naming pattern #50

Closed quisquous closed 2 years ago

quisquous commented 3 years ago

Feedback from @cterefinko. It looks like all of the examples call the value that getScreens() returns to be screensInterface to avoid saying screens.screens. Maybe there's a better name for getScreens?

quisquous commented 3 years ago

Also mentioned on the tag review: https://github.com/w3ctag/design-reviews/issues/602#issuecomment-792919351

michaelwasserman commented 3 years ago

Here are some notes I took during API design sessions aiming for more consistent and reasonable naming. I added @kenchris's ScreenDevices suggested alternative interface name from the TAG review too.

I could try to add more color to all the options, but I generally believe that a getScreens() function, a Screens interface, and a screens FrozenArray member are reasonable, despite the minor potential awkwardness of code like (await getScreens()).screens or let screens = await getScreens(); let myScreen = screens.screens[0];, etc.

kenchris commented 2 years ago

I like getScreenDetails().screens - makes a lot of sense

michaelwasserman commented 2 years ago

Thanks for the feedback here, we'll make this change soon, and may rename some interfaces in tandem: