Brdsnest Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
irelephant [he/him]@lemmy.dbzer0.com to Programmer Humor@programming.dev · 2 days ago

: (

lemmy.dbzer0.com

message-square
30
fedilink
292

: (

lemmy.dbzer0.com

irelephant [he/him]@lemmy.dbzer0.com to Programmer Humor@programming.dev · 2 days ago
message-square
30
fedilink
  • Hadriscus@jlai.lu
    link
    fedilink
    arrow-up
    11
    ·
    2 days ago

    What do you use instead of booleans ? floats ?

    • MultipleAnimals@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      42
      arrow-down
      2
      ·
      2 days ago

      strings “true” and “false” ofc like any sane developer

      • Valmond@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        26
        ·
        2 days 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
          link
          fedilink
          arrow-up
          3
          ·
          13 hours ago

          This is awful and aweful at the same time.

      • Hadriscus@jlai.lu
        link
        fedilink
        arrow-up
        27
        ·
        2 days ago

        good fucking god

        • kubica@fedia.io
          link
          fedilink
          arrow-up
          31
          ·
          2 days 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
            link
            fedilink
            arrow-up
            23
            ·
            2 days ago

            lord mary joseph make it stop

            • sznowicki@lemmy.world
              link
              fedilink
              arrow-up
              21
              ·
              2 days ago

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

    • The Ramen Dutchman@ttrpg.network
      link
      fedilink
      arrow-up
      4
      ·
      1 day ago

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

    • irelephant [he/him]@lemmy.dbzer0.comOP
      link
      fedilink
      arrow-up
      10
      ·
      2 days ago

      Sometimes it’s 0 and 1

    • deadbeef79000@lemmy.nz
      link
      fedilink
      arrow-up
      11
      arrow-down
      1
      ·
      edit-2
      2 days 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
        link
        fedilink
        arrow-up
        5
        ·
        2 days ago

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

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 341 users / day
  • 4.27K users / week
  • 8.18K users / month
  • 18K users / 6 months
  • 1 local subscriber
  • 31.4K subscribers
  • 2.01K Posts
  • 63.7K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org