5 ms·
So what happens if you plug your laptop into a docking station that has its own backlight? What if a new laptop comes out that has multiple backlights (perhaps
by dooglius 7y ago
So what happens if you plug your laptop into a docking station that has its own backlight? What if a new laptop comes out that has multiple backlights (perhaps of different colors)? In both of these circumstances the assumption that there is one backlight is faulty and not future-proofed.
Not to mention that the units don't carry over from one vendor to another.
- cnst 7y ago> Not to mention that the units don't carry over from one vendor to another. Who cares about the units? When was the last time you used a vendor-provided utility to configure a Network Interface Card, instead of just using ifconfig (if you're on BSD)? On OpenBSD, there's also bioctl for RAID management, too — https://en.wikipedia.org/wiki/Bioctl https://en.wikipedia.org/wiki/Bioctl. And sysctl hw.sensors for temperature sensors and more. How's brightness any different? It's a percentage value from 0 to 100%. Would the user really care how many internal settings a given machine has, and that 100% is really just 16 internally?
- theamk 7y agoSure they do! When I press "brightness up" shortcut on my keyboard, I want my laptop to brighten by 1 physical step, or by 2%, whatever is bigger. Having to press the key multiple times just to get any effect is super frustrating.
- cnst 7y agoI think those shortcuts are often handled by the driver itself, so, it'll already know the required stepping. Another option could be to provide such stepping explicitly as another sysctl. Otherwise, realistically, the keyboard shortcut stepping could simply be assumed to have only 16 variations in the first place, even if you're still using a percentage point through the interface.
- delusional 7y agoYou expose a second, more specific, value. Then provide a useful fallback for when you set the old generic value. If you have a multicolored backlight, then a user of the old abstraction just wants white. If there's multiple backlights, you could just dim them all. This is what an abstraction is. The abstraction doesn't need to cover all possible cases in the future. You just have to pick what that abstraction will mean for your new thing when you have it.