Skip to main content

Posts

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, c...

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 ca...

Triple Quotes

I am sure everyone has heard of the terms single quote, and double quote, but have you heard of triple quote? Yes such a term does exist, and it means three consecutive single or double quotes. So ‘’’ is a triple quote, and so is “””.

The Samurai Principle for Exception Handling

When a method fulfills it's responsibility, it is very clear what to return. We return the desired result object. However sometimes it is a bit unclear what to do when a method does not totally fulfill its responsibility. Do we return a null, do we return a partially populated object, or do we throw an Exception. Most of these situations can be resolved by applying the Samurai Principle - Return victorious, or not at all. If a function fulfills its responsibilities, return the appropiate result object, and if it doesn't then throw an Exception. Can this principle have any exceptions? I cannot think of any at the moment. Do let me know if you come accross any.

English Language Primer (contd.)

Continuing from yesterday... a bit about adjectives and adverbs An adjective describes a noun. It usually follows the pattern "You are very _______________". For example "You are very misogynous", "You are very courageous", etc. Adjectives usually end in -ous, -ive, -as, -ed, -ic, etc. Adverbs are generally formed by adding a -ly to an adjective. Misogynously, courageously, etc are adverbs.

An English Language Refresher

Today I have deviated a bit from the original category of my postings. From software programming languages to the english language. Very often while I find that I have forgotten the grammer priciples I learned in school. So I decided to revise them, and thought I'd share the refresher on my blog site. Here goes... A noun is usually a thing. Nouns are preceded by words such as a, the, my, such, an, some. Some nouns are however difficult to identify. Words such as egoist, asceticism, and misogynist do not come accross as nouns right away. However if we put them in the context of a sentance... "... an egoist", "such asceticism...", "the misogynist...", then the above rule clearly identifies them as nouns. The confusion with these words is that at first glance they seem to be adjectives. "He is an egoist". Egoist is a description of a person 'He'. However because egoist is preceded with a 'an', it is a noun. This law is conistent ...

Software Quality

Lately I have been following a lot of discussions on software code quality. There seems to be a lack of consensus on what quality means. This is not very surprising, since quality is a very subjective term, it means different things to different people. Here's what it means to me: I believe every software is created for a specific purpose. The purpose usually defines the forces that act on the software. Most common forces that usually act on any software from a bsiness perspective are: 1. Adaptability - How well will the software adapt to changes 2. Reliability - How often will the software crash 3. Timeliness - How fast can we ship the software 4. Economy - How much will the software cost 5. Performance - Does the software have quick turnaround times 6. Scalability - Will the software continue to be performant if the user base were to increase substantially 7. Usability - How intuitive is it to use the software These business factors are usually achieved by the following technical...