Coder Social home page Coder Social logo

Comments (6)

jgm avatar jgm commented on June 8, 2024

Yes, I think a boolean "checked" (true|false) would make sense here. I'm not sure any more whether there was a reason for doing it that way. Maybe we were preserving the possibility of other values, e.g. "?", or different types of checks??

@matklad any thoughts?

from djot.js.

matklad avatar matklad commented on June 8, 2024

Checkboxes can have three different states. For example, with a list of nested checkboxes, there's often "some, but not all, child itmes are checked". As another case study, org mode seems to allow these three: [ ] [-] [X].

I'd say: If we only allow two states syntactically, checked: boolean makes most sense. If we have more than three states, than we need an enum of states.

Status quo, with two states and an enum, doesn't make much sense to me.

No informed opinion on whether we should have two-state or three-state checkboxes, deferring to jgm's taste here, but I maybe lean towards allowing three cases, org-style. Seems easy to support for us, and, if we don't do this, it would be hard to work-around for the user.

from djot.js.

matklad avatar matklad commented on June 8, 2024

org mode doccs: https://orgmode.org/manual/Checkboxes.html

from djot.js.

FrankFischer avatar FrankFischer commented on June 8, 2024

This has a lot to do with how we want to
think about decisions in everyday life and
then technology might be fine-tuned to model
the preferred way of thinking...

... and after thinking more about it i am
proposing a fourth value: "not clear":

  • "undefined": i did not think about it yet
  • "checked": yes - this is true
  • "unchecked": no - this is false
  • "not clear": i cannot decide

Fuzzy logic

  • 0.0 = this is false
  • 0.5 = undecided and
  • 1.0 = this is true
    might be a little bit too much... (?)

Atul Gawande
has done a lot to promote the use of checklists and i use them every day
(like most of all anesthesiologists worldwide) and he is one of my heroes..

His 'Checklist for Checklists'
Checklist for Checklists
and his WHO Surgery Safety Checklist
does not support my suggestion above!

For him a check is an action that has to be done...
... and not a query whose result gets documented.

Both interpretations sound good to me - i would
like to be able to use both of them.

But the underlying concept is different and
it is dangerous if one is taken for the other.

What should we do?

The boolean solution?
(although i like my 4-value solution and it includes the boolean one)

from djot.js.

jgm avatar jgm commented on June 8, 2024

A checkbox on an old-fashioned piece of paper has two states, usually: checked or not checked. There isn't any difference between "I didn't think about it" and "I thought about it and decided not to check it." That's the mental model I have. (Same is true of checkboxes in HTML.)

from djot.js.

FrankFischer avatar FrankFischer commented on June 8, 2024

Sounds logical.

A 'task' gets done or not (boolean).

And the 'answer to a binary question'
(yes/no/undecided/missing value/...)
is something different, very depending
on the use case and very easy to model
with the current syntax - like
:+: | :-: | :?: | :_:

from djot.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.