News for hackers. Stuff that matters.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by ilyt on Thursday January 19, 2023 @08:25AM (#34439997)
This should be just

    Fnurbification  [ON|off]
or

    Fnurbification  [X]
Maybe add some indication which is the default. Bonus points for actual context of the function when you hover over it.

Checkbox is fine, toggle switch is also fine as meaning is clear in both cases.

Every other solution should lead to whoever responsible for it being fired

Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by 4RealFreedom on Thursday January 19, 2023 @08:56AM (#34440278)
This can lead to additional problems. Say Fnurbification is a setting in code wrapped in an if block. Great, on or off is easy to follow. Now say the Disable Fnurbification is what is actually in code. Now, when someone has a problem with Fnurbification, you have to map state back and see that the inverse was coded for the IU and follow that down the stack. Don't even get me started on defaults. There is no good/easy answer here.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by jefftk on Thursday January 19, 2023 @09:21AM (#34440520)
There is an easy answer: "Disable Fnurbification" is not what should be in the code. Present the right interface to the user, and fix the code when practical. Presenting something backwards to the user only makes it harder to fix later.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by 4RealFreedom on Friday January 20, 2023 @12:08AM (#34449490)
I deal with hundreds of these types of selectors from some inherited code. When a disable changes 2 lines of code to wrap functionality in an if block v adding many scattered if blocks to accommodate the enable case, I'll probably go with the low code solution. If I can easily accommodate enables then sure but it's just not always that easy.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by jefftk on Friday January 20, 2023 @08:16AM (#34452703)
This is just about what to call the variable. Instead of:

    if disable_foo:
      ...
I'm recommending:

    if not enable_foo:
      ...
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by soiler on Thursday January 19, 2023 @11:20AM (#34441990)
there is an easy answer if your code isn't written in a way that obfuscates its functionality to the maintainer...
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by account42 on Tuesday January 24, 2023 @04:47AM (#34501638)
The way your code is structured should never dictate the user interface. If that is inconvenient, adjust the code not the UI.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by jen20 on Thursday January 19, 2023 @09:10AM (#34440419)
This depends on whether the goal is transparency and clarity, or tricking users into enabling yet more “telemetry” surely?
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by layer8 on Thursday January 19, 2023 @09:24AM (#34440552)
> Fnurbification [X]

Actually, that should be:

  [x] Fnurbification
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by j33zusjuice on Thursday January 19, 2023 @09:31AM (#34440647)
Why? It feels better on the right, imo. It’s more natural, I see what it is, and then decide at the end to select or deselect. If it’s on the left, I now have to return to the beginning of the word. It’s not very natural.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by wiradikusuma on Thursday January 19, 2023 @09:53AM (#34440911)
I think it looks nicer if you have few elements with varying width:

[x] bla

[ ] this is a very long label

[ ] lorem ipsum

Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by layer8 on Thursday January 19, 2023 @10:02AM (#34441012)
Yes, it’s the same reason why bullet lists have the bullet on the left side.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by stronglikedan on Thursday January 19, 2023 @10:45AM (#34441531)
Even in Saudi Arabia?
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by layer8 on Thursday January 19, 2023 @10:49AM (#34441585)
No, I noted that in the other subthread: https://news.ycombinator.com/item?id=34440812

For RTL languages, everything is simply mirrored though: https://learn.microsoft.com/en-us/globalization/localizabili... It doesn’t change the general argument.

Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by chaorace on Thursday January 19, 2023 @10:57AM (#34441682)
More broadly, this is a consequence of English being a LTR language. The eye scans from left to right when reading these languages, so one naturally wants to place important visual symbols (bullets, controls, etc.) firstmost where they'll offer maximum contextual impact for the proceeding information.

The fixed-width nature of these elements is more of an afterthought that emerges because neat grids make information easier to parse and are generally considered to be visually pleasing. In RTL languages, the movement of the eye is mirrored, so the natural position of these elements also gets mirrored to the right-hand side. Of course, the fixed-width nature does not change because the instinct to craft neat grids exists regardless of directionality.

Recently, however, we have begun to see certain touch-based interfaces adopt right-aligned controls specifically, even in LTR configurations. This evolved to compensate for the fact that most people are right-handed and generally cannot reach across the width of a modern touchscreen one-handed. It's effectively a concession to accessibility and is best implemented as a toggleable feature to avoid disadvantaging left-handed users.

Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by glitchc on Thursday January 19, 2023 @10:54AM (#34441641)
Looks nicer but is less user-friendly.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by Tagbert on Thursday January 19, 2023 @09:05PM (#34448321)
More user friendly for parsing a list of different options.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by glitchc on Thursday January 19, 2023 @09:12PM (#34448365)
I disagree and I'm a user.

Buttons and toggles along the right margin and text on the left works for me. I prefer to read first what I'm turning on or off.

Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by TheAngush on Friday January 20, 2023 @01:11AM (#34449770)
There's a distinction between user-friendly and you-friendly, regardless of your individual status as a user.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by cyanydeez on Thursday January 19, 2023 @11:44AM (#34442348)
Easier to line up check boxes on left
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by zestyping on Thursday January 19, 2023 @03:02PM (#34444880)
The checkbox is closer to the text on the left. If it's on the right, there will be a gap that varies with the length of the longest item, making it harder to line up with its associated item.
Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by dotancohen on Thursday January 19, 2023 @12:14PM (#34442797)
The problem is that in English "on" and "off" are both adverbs and adjectives.

A designer that I once worked with came up with a terrific toggle switch, really the only one that works as well as the simple checkbox in my opinion:

https://ux.stackexchange.com/questions/1318/should-a-toggle-...

Re:Ask HN: Why are toggle switches replacing checkboxes? Isn... by mrguyorama on Thursday January 19, 2023 @12:45PM (#34443194)
But but but but skeumorphism is unfashionable and apple said it wasn't good anymore!!!!

You are supposed to design your UI as if it was made in ten minutes by a lazy high schooler making a powerpoint with all the defaults and just bulleted text on a blank background.