Tuesday, April 15, 2008

Passion or Obsession?

Well many might wonder why the choice of this title!

I was wondering a couple of days ago, whether it is normal that a guy spends hours solving a programming problem...or looking for and fixing a bug.

Then I asked myself...Could the passion I have for programming turn to obsession (or has it already?)...well i cannot answer.

Discussing that with some friends today...i got a variety of answers! Some said..the obsession is the passion, others said that that's the fun of it...and others said keep going...it cannot kill you!

As some readers are aware, i am always inclined to optimising codes in C++ implementations. How far will this take me?

Well actually yesterday's posting was simply something i wrote one day while I was still at Accenture...i.e about one year ago..and i found it lying in one of my folders.

Anyways, the reason for no proper posting in the last few days was that i was stuck with a programming bug and i finally managed to solve it with the help of a student (Thx Kervin!!!).

It was about adding a node to a binary tree.

void BTree(TNode * T, TNode *K)//where K is the node to be added
{

if (T-> getKey()< K- > getKey())//We will add to the right subtree of T
{
if (T-> getLeft()!=NULL)
{
insertTree(T- > getLeft(), K);
}
else
{
T- > setLeft(K);
}
}

else//We will add to the right subtree of T
{
if (T- > getRight()!=NULL)
{
insertTree(T- > getRight(), K);
}
else
{
T- > setRight(K);
}
}
}//function

There was another implementation which i studied when i was a student, but this one seems easier...even though the other one achieves exactly the same operation.

The fact that i was stuck for hours with the fact that i had an extra recursive call
in a function similar to the one i obtained from wikipedia (Passionate reader, please read!):

void InsertNode(struct node *&treeNode, struct node *newNode)
{
if (treeNode == NULL)
treeNode = newNode;

else
if (newNode - > value < treeNode- > value)
InsertNode(treeNode- > left, newNode);

else
InsertNode(treeNode- > right, newNode);
}

It seems to me that he is passing a pointer by reference (how subtle is that?, and since it is a structure, no member function...i thought of that too...how cool..., so, InsertNode need not be a member function of the class BTree..HIHIHIH!!! )....

I tried it, but i did not manage to get it working. Well i agree that he made use of a structure...but that not the issue...i will have to try it again tomorrow!

Well...right now..i am asking myself a question:
Can we be obsessed about our passion, or passionate about an obsession!

Comments welcome!

5 comments:

Anonymous said...

Ahh what a big dilema!! Passion or Obsession?? I would prefer to use the word "SATISFACTION".

For example:
A programmer would use one or (in nowadays case its) many programming language to express themself!! In this case they express themself for their own satisfaction.. they express to bring peace to their mind because no one else would understand what he has written.. viewing the code and executing it would be a real satsifaction for him( when there is no bug or error)

Whereas many people would tend to use natural language to express themselves but for the satisfaction of others lol for example, a lecturer(a ne pa se sentir viser svp haha jst kidding) would express himself for the student to understand to satisfy their thirst of knowledge( well if they're really thirsty or they are just breaking a pose!! lol). another example is a boy would express himself to satisfy his girlfriend and vice versa!! lol

Well from the above words we can see that ( in my opinion ) above Passion and Obsession there is Satisfaction!!

SuNdeeP _

Anonymous said...

Hehehe! I think we'd get to see more of that on Friday, sir? I remember that last slide where we were struggling to understand the concept of inserting nodes, and we got stuck because it was supposed to be done the week after.

Hope it's clearer this time. I find the concept of recursion to add new "nodes" to a tree nice. It's elegant you might say. :)

Anon :)

Anonymous said...

I agree with SuNdeeP _:
another example is a boy would express himself to satisfy his girlfriend and vice versa!! lol


Euhmmm I mean that satisfaction is another way way to express passion/obcession :P

Can we be obsessed about our passion, or passionate about an obsession!

To that question I would like to ask another question: How is it that we reached our current level in what we are doing? Is it that passion which makes do things in such a way that we come to like what we do?

Now to answer your question,
I think we cant call our passion obcession, else it would be like: morning=passion, noon=passion, nite=passion, before sleeping=passion. That’s what I call obsession: constantly thinking about what we like…is it the case for a certain lecturer? :P lol
Who knows :P


darklide

G@V!N said...

Let's drop the boyfriend-girlfriend analogy...the issue is more important. LOL

How is it that we reached our current level in what we are doing? Is it that passion which makes do things in such a way that we come to like what we do?

With reference to the phrase in bold...well this is soooo subjective! :-)

I believe that one should not come to like what he does, i prefer him to do what he likes....(That's me only playing with words!!!)

I find the concept of recursion to add new "nodes" to a tree nice. It's elegant you might say. :)
.....Exactement!!!!!

Only people in love appreaciate elegance (irrespective of what or who they are in love with....)

That’s what I call obsession: constantly thinking about what we like…is it the case for a certain lecturer? :P lol
Who knows :P

.....Well who could that lecturer be...li bizin extra manque role!!!! LOL!!!!

Today I had a discussion with a friend of mine about Programming, and he said we would be happy if Programming could make people slim!!!

Hell No!!!!! Many of us would be skeletons by now!!!

Though proper brain exercise does burn calories, We are lucky that it does not burn that many!

Anonymous said...

For the poll results, i think the word obsession conveys a wrong impression. Maybe, that's why the results are so close.