▲ 300 ▼ : ( (lemmy.dbzer0.com) submitted 3 months ago by irelephant@lemmy.dbzer0.com to c/programmer_humor@programming.dev 34 comments fedilink hide all child comments
[–] Hadriscus@jlai.lu 11 points 3 months ago (4 children) What do you use instead of booleans ? floats ? permalink fedilink source hideshow 8 child comments replies: [–] MultipleAnimals@sopuli.xyz 43 points 3 months ago (2 children) strings "true" and "false" ofc like any sane developer permalink fedilink source parent hideshow 4 child comments replies: [–] Valmond@lemmy.dbzer0.com 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! 😐🫤 permalink fedilink source parent hideshow 4 child comments replies: [–] felbane@lemmy.world 5 points 3 months ago (1 child) This is awful and aweful at the same time. permalink fedilink source parent hideshow 2 child comments replies: [–] Valmond@lemmy.dbzer0.com 1 point 3 months ago* (last edited 2 months ago) Non affective, non effective. permalink fedilink source parent [–] psud@aussie.zone 3 points 2 months ago The system I work on uses "Y" and "N". permalink fedilink source parent [–] Hadriscus@jlai.lu 27 points 3 months ago (1 child) good fucking god permalink fedilink source parent hideshow 2 child comments replies: [–] kubica@fedia.io 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. permalink fedilink source parent hideshow 2 child comments replies: [–] Hadriscus@jlai.lu 23 points 3 months ago (1 child) lord mary joseph make it stop permalink fedilink source parent hideshow 2 child comments replies: [–] sznowicki@lemmy.world 23 points 3 months ago And for double fun if the output doesn’t matter you can make if endsWith(“e”). permalink fedilink source parent [–] deadbeef79000@lemmy.nz 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 permalink fedilink source parent hideshow 2 child comments replies: [–] SpaceNoodle@lemmy.world 5 points 3 months ago I think you could use a CHECK constraint to effectively create en enum permalink fedilink source parent [–] irelephant@lemmy.dbzer0.com [S] 10 points 3 months ago Sometimes it's 0 and 1 permalink fedilink source parent [–] lord_ryvan@ttrpg.network 4 points 3 months ago Smallest INT it can support and only ever use 0 and 1. permalink fedilink source parent
[–] MultipleAnimals@sopuli.xyz 43 points 3 months ago (2 children) strings "true" and "false" ofc like any sane developer permalink fedilink source parent hideshow 4 child comments replies: [–] Valmond@lemmy.dbzer0.com 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! 😐🫤 permalink fedilink source parent hideshow 4 child comments replies: [–] felbane@lemmy.world 5 points 3 months ago (1 child) This is awful and aweful at the same time. permalink fedilink source parent hideshow 2 child comments replies: [–] Valmond@lemmy.dbzer0.com 1 point 3 months ago* (last edited 2 months ago) Non affective, non effective. permalink fedilink source parent [–] psud@aussie.zone 3 points 2 months ago The system I work on uses "Y" and "N". permalink fedilink source parent [–] Hadriscus@jlai.lu 27 points 3 months ago (1 child) good fucking god permalink fedilink source parent hideshow 2 child comments replies: [–] kubica@fedia.io 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. permalink fedilink source parent hideshow 2 child comments replies: [–] Hadriscus@jlai.lu 23 points 3 months ago (1 child) lord mary joseph make it stop permalink fedilink source parent hideshow 2 child comments replies: [–] sznowicki@lemmy.world 23 points 3 months ago And for double fun if the output doesn’t matter you can make if endsWith(“e”). permalink fedilink source parent
[–] Valmond@lemmy.dbzer0.com 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! 😐🫤 permalink fedilink source parent hideshow 4 child comments replies: [–] felbane@lemmy.world 5 points 3 months ago (1 child) This is awful and aweful at the same time. permalink fedilink source parent hideshow 2 child comments replies: [–] Valmond@lemmy.dbzer0.com 1 point 3 months ago* (last edited 2 months ago) Non affective, non effective. permalink fedilink source parent [–] psud@aussie.zone 3 points 2 months ago The system I work on uses "Y" and "N". permalink fedilink source parent
[–] felbane@lemmy.world 5 points 3 months ago (1 child) This is awful and aweful at the same time. permalink fedilink source parent hideshow 2 child comments replies: [–] Valmond@lemmy.dbzer0.com 1 point 3 months ago* (last edited 2 months ago) Non affective, non effective. permalink fedilink source parent
[–] Valmond@lemmy.dbzer0.com 1 point 3 months ago* (last edited 2 months ago) Non affective, non effective. permalink fedilink source parent
[–] psud@aussie.zone 3 points 2 months ago The system I work on uses "Y" and "N". permalink fedilink source parent
[–] Hadriscus@jlai.lu 27 points 3 months ago (1 child) good fucking god permalink fedilink source parent hideshow 2 child comments replies: [–] kubica@fedia.io 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. permalink fedilink source parent hideshow 2 child comments replies: [–] Hadriscus@jlai.lu 23 points 3 months ago (1 child) lord mary joseph make it stop permalink fedilink source parent hideshow 2 child comments replies: [–] sznowicki@lemmy.world 23 points 3 months ago And for double fun if the output doesn’t matter you can make if endsWith(“e”). permalink fedilink source parent
[–] kubica@fedia.io 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. permalink fedilink source parent hideshow 2 child comments replies: [–] Hadriscus@jlai.lu 23 points 3 months ago (1 child) lord mary joseph make it stop permalink fedilink source parent hideshow 2 child comments replies: [–] sznowicki@lemmy.world 23 points 3 months ago And for double fun if the output doesn’t matter you can make if endsWith(“e”). permalink fedilink source parent
[–] Hadriscus@jlai.lu 23 points 3 months ago (1 child) lord mary joseph make it stop permalink fedilink source parent hideshow 2 child comments replies: [–] sznowicki@lemmy.world 23 points 3 months ago And for double fun if the output doesn’t matter you can make if endsWith(“e”). permalink fedilink source parent
[–] sznowicki@lemmy.world 23 points 3 months ago And for double fun if the output doesn’t matter you can make if endsWith(“e”). permalink fedilink source parent
[–] deadbeef79000@lemmy.nz 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 permalink fedilink source parent hideshow 2 child comments replies: [–] SpaceNoodle@lemmy.world 5 points 3 months ago I think you could use a CHECK constraint to effectively create en enum permalink fedilink source parent
[–] SpaceNoodle@lemmy.world 5 points 3 months ago I think you could use a CHECK constraint to effectively create en enum permalink fedilink source parent
[–] irelephant@lemmy.dbzer0.com [S] 10 points 3 months ago Sometimes it's 0 and 1 permalink fedilink source parent
[–] lord_ryvan@ttrpg.network 4 points 3 months ago Smallest INT it can support and only ever use 0 and 1. permalink fedilink source parent