Two cute programmer jokes

This one amused me...

protected void On_DayLoad(object sender, EventArgs e) {
  Beverage coffee = new Beverage("coffee");
  coffee.Add(Beverage.Sweetener.Sugar);
  coffee.Cream = false;
  Cup mug = new Cup();
  mug.Add(coffee);
  Me.Consume(mug);
  mug.Dispose();
}

Of course, you could argue that the hard-coded string in the Beverage class constructor is bad design, but it’s only a joke eh?

This one is an old one, but I liked the variation of answer...

Question: How many programmers does it take to change a light bulb?

Answer 1: None, it's a hardware issue

Answer 2: A properly designed light bulb object would inherit a Change() method from a generic base Lighting class, so all you'd have to do is send a light bulb change message

Comments

a cup of warm milk 1st November 2021

You ate the mug????????

Avrohom Yisroel Silver 22nd December 2021

Ah, you spotted the bug in my code! Or was that the bug in my mug?

Either way, that explains all those null reference exceptions and network time-outs I saw in that application.

Thanks for that, I better go and do some bug-fixing!

Leave a comment