Thursday, February 5, 2009

Compilation error...

If you are a developer and your code is not working / doing wierd things, you like to know upto what point it works properly. For that the most popular way is to put print statements in between the code. Isnt that what you do often?

Well, our boss had some problem with some code, so he went to Tina, and asked her to see whats going wrong. To find, where it is going wrong Tina added a print statement like this @ line 39....

34 $response=;
35 chomp $response; #print"You entered $response\n\n";
36 unless($response eq "Yes" $response eq "Y" $response eq "y") { next; }
37 $line=~ /^(\d*),.*/; $id=$1;
38 $cmd = "c:\\PROGRA~1\\DEBUGG~1\\symstore.exe del /i ${id} /s $thedir";
39 print "Now I am at line 38";

On seeing this the boss started screaming, "wait wait what are you doing?"
"The code is going to crash, it would throw compilation error..."
She was shocked to see that the boss knows things technically and so started to see what wrong she did in the code. She didnt find any mistake. So she asked,"Whats wrong, Boss?"

He said, "ये तुमने क्या किया ? तुम लाइन ३९ पे लिखते हो 'इ ऍम अत लाइन ३८' , फ़िर कोड तो compilation error देगा ना । "
Arent we lucky to have this free entertainment ?

She never wanted to educate the boss, so she said "Ohh ya.. thanks for bringing it before we compiled" and then changed the line as:
39 print "Now I am at line 39";
And he was really happy.