Theory and practice

In theory there is no difference between theory and practice, but in practice there is.

  • Theory: everything is clear, but nothing works;
  • Practice: everything works, but nothing is clear;
  • Sometimes theory meets practice: nothing works and nothing is clear.

Importance of Original Knowledge

Principle #1: Don't trust retellers, get hold of the original sources.

A new monk arrives at the monastery. He is assigned to help the other monks in copying the old texts by hand. He notices, however, that they are copying copies, and not the original books.

So, the new monk goes to the head monk to ask him about this. He points out that if there was an error in the first copy, that error would be continued in all of the other copies. The head monk says, "We have been copying from the copies for centuries, but you make a good point, my son."

So, he goes down into the cellar with one of the copies to check it against the original. Hours later, nobody has seen him. So, one of the monks goes downstairs to look for him. He hears sobbing coming from the back of the cellar and finds the old monk leaning over one of the original books crying. He asks what's wrong.

"The word is celebrate not celibate," says the old monk with tears in his eyes.

What if "else"?

Principle #2: A real programmer always takes care of both "if" and "else" cases. So should we.

Before going to bed a programmer puts on his night stand two glasses: one with water and one empty. When his wife asked him "why?" he said:
"One with water is there in case I wake up at night and I feel thirsty".
"How about the other one?" - still not getting the point asked his wife.
"Oh! This is in case I wake up at night and I am not thirsty!" - replied the coding guru.

Know where to stop

Principle #3: Don't get trapped in infinite loops. Always provide an exit condition.

A programmer didn't show at work on Monday. After tree days of not having any news from him his colleagues started to worried and have decided to go visit his place to see what could happen.

After 30 minutes of ringing the bell and knocking the door, they broke into his house and found him in a bath tub, sitting in cold water, absolutely bold staring at an empty shampoo bottle that he held in his hand. He didn't reply any question his friends were asking him, nor even noticed their presence. He simply was continuing looking at the shampoo bottle label in a manner of zombie.

When his friends managed to take this bottle out of his stark hands, they could read the following instruction: "Pour a small amount of shampoo on a palm of your hand, work through wet hair. Rinse. Repeat."

back to main page