• unalivejoy
    link
    fedilink
    English
    2117 hours ago

    Even booleans take up 8 bits. And that’s a lot of wasted space.

    • @ZILtoid1991
      link
      57 hours ago

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

  • @steventhedev
    link
    3720 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.

  • @[email protected]
    link
    fedilink
    English
    1419 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.

      • @spongebue
        link
        814 hours ago
        public boolean isMale() {
            return !isFemale();
        }
        
        public boolean isFemale() {
            return !isMale();
        }
                  
        
    • @ZILtoid1991
      link
      3
      edit-2
      6 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
      }
      
      • @[email protected]
        link
        fedilink
        English
        23 hours ago

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