News for hackers. Stuff that matters.
Re:Settings are not a design failure by mark-r on Thursday February 03, 2022 @12:57PM (#30195984)
The last product I worked on, we had constant problems sometimes trying to reproduce bugs. Accessing a feature through a keyboard shortcut vs. a menu might take you down a completely different code path, and it was critical to know which way the user was using.
Re:Settings are not a design failure by freedomben on Thursday February 03, 2022 @02:04PM (#30197084)
Yes I agree, although having gone through that several times in different frameworks, I am now a believer that you can avoid the majority of issues like that by keeping state centralized (like redux pattern) and building components in a functional-reactive way (no state in components). Of course this doesn't help much if you're using Java Swing, but the vast majority of products that I run into this are web-based. The "always re-render" approach of React can help a ton. With that you have two separate event handlers (one for the click, one for the key press) but both of them simply update the "state" variable for whatever it is. The framework then figures out what needs to change and does it.
Re:Settings are not a design failure by mixmastamyk on Friday February 04, 2022 @12:14AM (#30203152)
Sounds like a poor design. The events should call the same function.