28

My Javascript professor explained Boolean to me using an allegory about pizza: "If I give you pizza, under what condition do you eat it? Your hunger must be true or false. Boolean does the same thing, but with things less exciting than pizza."
It didn't even begin to make sense to me until it became about pizza.
I vote for ALL future computer classes to be taught in terms of pizza.

Comments
  • 9
    throw new FoodPoisoningException();
  • 4
    while (true)
    {
    LovePizza();
    }
  • 9
    Some refactoring...

    while (true)
    {
    try
    {
    if(_pizza.Contains(Topping.Pineapple)
    throw up;

    EatPizza();
    }
    catch
    {
    Console.Log("You monster!");
    }
    }

    And naturally _pizza is private!
  • 22
    I also eat pizza when hunger is false.
  • 4
    @aronmik Pizza eating is a coroutine.
  • 0
    A Boolean is just a 1 or a 0, which are you?
  • 0
    Intellisense: "Would you like to set _Pizza to public?"
  • 0
    .... wow... just wow
  • 1
    Yes, but his statement is false, under what conditions do you eat pizza?

    hunger | !hunger

    Its pizza.
  • 0
    I don't mean this in a mean way but I never really thought someone could be confused by true/ false.
  • 1
    @AlgoRythm It wasn't really the true / false aspect of it; he assigned us to rewrite mathematical inequalities as boolean statements and I had no idea what that meant.
  • 0
    @gameshark Ah, fair enough. Boolean logic has always been second nature to me.
Add Comment