Wednesday, March 19, 2008

Debugging and The Art of Saving Your Ass



This reminded me of a similar experience while in college. I had written a program for one of my advanced programming practical exam and it worked but i couldn't figure out for the life of me why it always printed "Segmentation fault" (SF) at the end. When the professor came to check whether the program was working (and hence assign the marks), i calmly ran the program. The program was executing and spitting out various results and the professor was nodding his head all along (like a seasoned rap star) until the SF came out. He stopped his head-nodding and slowly lifted his finger (thankfully not his middle one) and asked me "Rejoy, why don't you explain to me how you got this error". So i looked at him, gave my best devilish grin and said "Actually, i typed in:

printf("Segmentation fault\n");

at the end of the program." (Meaning that i deliberately made the program print SF). The guy actually roared with laughter and clapped me on the shoulder. I think i will save this answer for one of my job interviews ;-)

6 comments:

Reni said...

i've often noticed dat sometimes knowledge is not everything....v all need a bit of charm n wit 2 get along or puttin it in ur words, "2 save our ass"....

tom said...

what a geek..

Shimmer said...

yes... very smart!! *pats on head* :P
its amazin how we usually find that nerds r totally clueless when it comes to practical issues... (at the risk of soundin prejudiced ofcourse )but ur not like that which ultimately saved ur ass... nice :) :)


cheers!!

Roshan R said...

Haha.. Quick thinking has saved many a student's ass. Reminds me so much of some of the crap i used to get away with

Rejoy said...

@reni
right little sis. Charm is a form of political maneuvering after all. Maybe i should think about joining politics. Not yet. I still have to practice my "namaste" gesture.

@tom
look who's talking, buddy ;)

@shimmer
hey! watch it! u'r spoiling my hairstyle. Hmmph!

@roshan
may there be more crap to get away with, my friend. cheers!

Saju Muthalaly said...

That was very clever! Funny as well! :0)