you are viewing a single comment's thread
view the rest of the comments
[–] 11 points 3 months ago (4 children)

What do you use instead of booleans ? floats ?

  • source
  • hideshow 8 child comments
  • [–] 43 points 3 months ago (2 children)

    strings "true" and "false" ofc like any sane developer

  • source
  • parent
  • hideshow 4 child comments
  • [–] 29 points 3 months ago (2 children)

    I got a better one: O for true and N for false.

    Seen in production for quite important stuff (payment requests).

    O is from Oui, N from Non, of course!

    😐🫤

  • source
  • parent
  • hideshow 4 child comments
  • [–] 27 points 3 months ago (1 child)
  • [–] 33 points 3 months ago (1 child)

    it allows for mood changes, some parts of the code can check charAt(0) == 't'others can do val != 'false' just let it flow.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 11 points 3 months ago* (1 child)

    Use a CHAR(1) you can then use it as an enumeration.

    Don't use T/F for true/false use it for the actual sematic meaning for the thing that the Boolean is toggling. E g. S for subscribed, U for unsubscribed, or whatever.

    It also means when you inevitably grow to needing a tri-state it makes sense.

    Unless SQLite actually supports enumerations, then just use them

  • source
  • parent
  • hideshow 2 child comments