294
: ( (lemmy.dbzer0.com)
you are viewing a single comment's thread
view the rest of the comments
[-] Hadriscus@jlai.lu 10 points 2 weeks ago

What do you use instead of booleans ? floats ?

[-] MultipleAnimals@sopuli.xyz 45 points 2 weeks ago

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

[-] Valmond@lemmy.dbzer0.com 28 points 2 weeks ago

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!

😐🫤

[-] felbane@lemmy.world 5 points 1 week ago

This is awful and aweful at the same time.

[-] Valmond@lemmy.dbzer0.com 1 points 1 week ago* (last edited 1 week ago)

Non affective, non effective.

[-] psud@aussie.zone 3 points 1 week ago

The system I work on uses "Y" and "N".

[-] Hadriscus@jlai.lu 27 points 2 weeks ago
[-] kubica@fedia.io 32 points 2 weeks ago

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

[-] Hadriscus@jlai.lu 23 points 2 weeks ago

lord mary joseph make it stop

[-] sznowicki@lemmy.world 23 points 2 weeks ago

And for double fun if the output doesn’t matter you can make if endsWith(“e”).

[-] deadbeef79000@lemmy.nz 12 points 2 weeks ago* (last edited 2 weeks ago)

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

[-] SpaceNoodle@lemmy.world 5 points 2 weeks ago

I think you could use a CHECK constraint to effectively create en enum

[-] irelephant@lemmy.dbzer0.com 9 points 2 weeks ago

Sometimes it's 0 and 1

[-] lord_ryvan@ttrpg.network 4 points 1 week ago

Smallest INT it can support and only ever use 0 and 1.

this post was submitted on 10 May 2026
294 points (100.0% liked)

Programmer Humor

31548 readers
153 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS