Ein kleiner Witz


#1

Just thought I’ll leave that here, as it reminded me on my humble beginnings with code at ATS:

The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
The programmer comes home with 12 loaves of bread.


#2

I love it. You get a bonus MFA. :slightly_smiling:


#3
function numLoavesOfBreadToBuy() 
{
    if (storeHasEggs() == true)
    {
         return 12;
    }
    else
    {
         return 1;
    }           
}

function storeHasEggs()
{
  return Math.random() > 0.5;
}


function tellJoke()
{
    var n = numLoavesOfBreadToBuy();
    console.log("Bought " + n + " loaves of bread.");
}