• Gladaed@feddit.org
      link
      fedilink
      arrow-up
      4
      ·
      5 hours ago

      That’s only due to technical reasons on weird platforms like x86, 64bit x86 or ARM.

    • ZILtoid1991@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      9 hours ago

      That’s why you use bitarrays and bitflags instead when you need more than just one or two arguments for a function.

      • Excrubulent@slrpnk.net
        link
        fedilink
        English
        arrow-up
        2
        ·
        13 minutes ago

        Only if it’s performance sensitive. Otherwise you’re wasting programmer time both writing and reading the code, and you’ve made it less maintainable with more complexities where bugs can creep in.

        The vast majority of the time you can afford a few wasted bits.

        Honestly though I don’t quite understand why a compiler couldn’t optimise this process. Like it knows what a boolean is, surely it could reduce them down to bits.

  • steventhedev@lemmy.world
    link
    fedilink
    arrow-up
    38
    ·
    23 hours ago

    Clearly your gender field is a boolean. Which means it can be either true, false, null, or undefined. Except in javascript where for some reason it can sometimes be NaN, but only when you try to compare two people.

  • bishbosh@lemm.ee
    link
    fedilink
    English
    arrow-up
    16
    arrow-down
    1
    ·
    21 hours ago

    Bold of programmers to assume gender can be expressed accurately in a finite discrete system. Gonna have to bust the Taylor series for some better approximation.

    • ZILtoid1991@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      9 hours ago

      Gender is a struct

      struct Gender {
        byte binaryBias;    ///Determines male (+) or female (-) bias if present
        ubyte binaryAm;    ///Determines the amount of binary gender(s) present
        bool isTrans;    ///True if assigned at birth gender does not equal with current one
        ubyte xenoAm;    ///Determines the amount of xenogender
        uint xenoGen;    ///Xenogender selection, 0 if not applicable
        Sex* sex;    ///Pointer to the person's current sex
      }
      
      • activ8r
        link
        fedilink
        English
        arrow-up
        2
        ·
        6 hours ago

        Now this is a gender definition I can get behind. None of that string/enum crap, just raw data.