• 0 Posts
  • 27 Comments
Joined 1 year ago
cake
Cake day: July 1st, 2023

help-circle

  • Surely we could optimize the return value with a switch statement and store the result as an integer to hide the compiler warning about our clearly correct code:

    internal static bool AreBooleansEqual(bool orig, bool val)
    {
        int result;
        if(orig) 
        {
            if(val)
            {
                result = 0;
            }
            else
            {
                result = 1;
            }
        }
        else
        {
            if(val)
            {
                result = 1;
            }
            else
            {
                result = 0;
            }
        }
        switch (result)
        {
             case(1):
                 return true;
             case(0):
                 return false;
             default:
                 return AreBooleansEqual(orig, val);
        }
    }
    

    New LOC: 35



















  • “I use Linux as my operating system,” I state proudly to the unkempt, bearded man. He swivels around in his desk chair with a devilish gleam in his eyes, ready to mansplain with extreme precision. “Actually”, he says with a grin, "Linux is just the kernel. You use GNU+Linux!’ I don’t miss a beat and reply with a smirk, “I use Alpine, a distro that doesn’t include the GNU Coreutils, or any other GNU code. It’s Linux, but it’s not GNU+Linux.”

    The smile quickly drops from the man’s face. His body begins convulsing and he foams at the mouth and drops to the floor with a sickly thud. As he writhes around he screams “I-IT WAS COMPILED WITH GCC! THAT MEANS IT’S STILL GNU!” Coolly, I reply “If windows were compiled with GCC, would that make it GNU?” I interrupt his response with “-and work is being made on the kernel to make it more compiler-agnostic. Even if you were correct, you won’t be for long.”

    With a sickly wheeze, the last of the man’s life is ejected from his body. He lies on the floor, cold and limp. I’ve womansplained him to death.