Thursday, June 09, 2005

Do Your Best

A very long time back I had read in a book: “Do your best and let god take care of the rest”. Sounds like a very simple line but if you think of it carefully it actually sums up the essence of how we must live our lives in just a few words. All of us have experienced times when we do not have any control over what happens. All we can do is try our very best and pray that events turn out in our favor. In such times it is very easy to fall prey to fatalism and think that all events in our lives are pre-destined.
But in reality it is not so. Ramana Maharishi used to say that the only control we have is over our reaction to events that happen to us. It is this reaction that sows the seeds of future events. If the reaction is positive, meaningful, and benign then it will pave the way for better future events. The Bhagwad Gita preaches: “Perform your duty in the best possible way and relinquish the fruits of your actions to god”. Applying this simple principle will help us lead meaningful, constructive lives, devoid of stress and tension. The importance of this principle in our professional life is also very significant. Stress is an occupational hazard for software professionals. We are constantly battling (often unrealistic) project deadlines. The stress is sometimes compounded by personal and health problems. How does one prevent stress from mounting.
The simplest way is to work for a company that believes in 40 hour weeks. But would that be fun? Probably not. The next best thing is to control stress at a personal level. Even when the entire team is going berserk, we can still remain calm, try our best, leave no stone unturned, and then just call it a day and let god take care of the rest. Do not mistake this for escapism. The idea is not to escape from work, but to understand that there is a point beyond which more effort becomes counter-productive. It actually causes loss of efficiency, productivity, and health.

Wednesday, June 08, 2005

Writing, does make you think

Yesterday I send an email to some friends about a particular Java feature. The original email read "JDK 1.5 has introduced a cool feature to allow overriden methods to have different return types". I had just read about this feature in a newsletter and decided to share it.
However just before clicking on the 'Send' button, I decided to review the mail to ensure that it was correctly phrased (I always have to review my first draft... even if it's just a line :-). While reading it again, I stopped at the word 'cool', and thought to myself - Is this a cool feature, or is it just a feature. Was the use of 'cool' appropriate here? This made me think a bit more about this feature. This feature was intended to remove the hassle of downcasting an object returned from a method. But wouldn't different return types for overriden methods break the "program to an interface" concept? Now the client code has to know the exact subclass that it is calling. Polymorphism is supposed to rid us of those long if...else statements, but to make use of this feature we will have to depend on them to tell us which subclass we have instantiated and are invoking a method of.
Now this feature does not look all that cool. Actually it seems that there is little purpose to this feature, except making the language more complex.
I was able to think this over because I decided to write about it... otherwise it still may have been a cool new feature for me. Offcourse it could still be a cool feature and I am open to a different perspective. But the point is that the process of writing helped me crystallize a concept which would not have happened otherwise.
Do drop in a note to tell me what you think about writing or about this new Java feature.