• pivot_root@lemmy.world
      link
      fedilink
      arrow-up
      30
      arrow-down
      1
      ·
      1 year ago

      Blasphemy! Unions are just algebraic data types without any guardrails. If the programmer misuses them, that’s their own fault for b$:, 9^\⊂ƒ~>[→ZzF™×#
      Segmentation fault (core dumped)

      • Rednax@lemmy.world
        link
        fedilink
        arrow-up
        15
        ·
        1 year ago

        My C++ teacher taught me to be against unions. He made everything class based instead.

        • pivot_root@lemmy.world
          link
          fedilink
          arrow-up
          10
          ·
          edit-2
          1 year ago

          How reckless, encouraging inheritance like that. My personal demon college tutor instructed me on the ways of Malbolge. In the end, life is just a list of self-modifying instructions.