Sunday, September 09, 2012

There is only one reality. That is Code. Everything Else is Illusion

There is only one reality. That is Code. Everything else (design and documentation etc.) is illusion.

Once I worked in a team, where the managers expected detailed design for everything. When, I say, we will have a single library for validation and data storage etc., they won't accept it. They expect the application to be modularized, and have many components. If somebody proposes multiple libraries, with each library doing one small work, they would be very happy about it.

I am very bad at presenting these things, and coming up with big architecture for very small problems. There was a person in my team, who is very good in these things. He came up with a design, in which, there are multiple libraries. One library for business logic and one for data storage etc.

There will be one business logic library, which does all the validations and processing of the data and the conversions from UI to DB and vice versa. The DB layer handles all the save and retrieval of data, and it is not burdened with any processing of the data or business logic. The entire business logic would be in the business logic library. In future, if the business logic grows, we can split into multiple libraries based on the functionality. Since, it is the first version, we can start with one library and see in the next release whether to split this library.

At the end, most of the methods in the business logic library are like this.
public BIObject GetBIObject(Parameters)
{
    return dbHandler.GetBIObject(Parameters)
}

public BIObject SaveBIObject(Parameters)
{
    return dbHandler.SaveBIObject(Parameters)
}
[For those who did not understand the above, the entire functionality (validation, storage and everything else) was developed in the data library. The business logic is just a wrapper with one line of code for each method.]

Everybody was happy by this method.

The managers were happy, because, the design is good, where there are multiple components, and it is modularized. The other developer was happy, because, the managers were impressed with his design. I was happy, because, the code was exactly the way, I wanted it to be. And, also, I was relieved from the burden of designing (which I never used anyway) and presenting it to the managers.


Related Links:
What does it take to convince a Manager?
Developing Libraries - Give Minimum Privileges

Monday, September 03, 2012

Gandhi - His Attitude on Power

It is very easy to say, "I don't care about money", while having nice dinner at a seven star hotel.

If we go by what is known to the majority of the people, Gandhi is very simple and he did not have any interest on power etc. Except at the very beginning, he did not show any interest in becoming the president of Congress, and after getting the Independence, he did not take any post in the government.

In the later part of Gandhi's life, he had full power. Whatever he asked, it was done. He had Nehru, who has done everything that he asked (till the Independence). So, Gandhi never needed to take the power officially.

In 1939, Subash Chandra Bose contested for the Congress President elections. Gandhi had put Pattabi Seetharamayya as his candidate. Pattabi Seetharamayya lost in the elections, and Subhash Chandra Bose became the president of the Congress.

Gandhi did not like that. He publicly said, that the defeat of Sitaramayya was his own defeat. He asked many people to resign from their posts and have given zero co-operation to Subash Chandra Bose. Gandhi did not even attend the meetings of Congress. Bose got frustrated with the things happened in Congress because of Gandhi, and left Congress.

In 1946, India was on the way to Independence. Congress was supposed to elect the first Prime Minister of India. 16 states supported Sardar Vallabai Patel and only one state supported Nehru. But, Gandhi asked Patel to withdraw, and asked him to give the way to Nehru. Patel accepted it and Nehru became the first Prime Minister of India.

Gandhi never wanted to take power. But, he always wanted people, who listens to him in everything, to take power. Eventhough, Gandhi did not hold any official posts most of the time, he had full powers most of the time. He had people who listened to him for everything. When he was having full power, it is very easy to say that, he does not care about power. The real picture would come out only, when the people who have power do not listen to him.

Tuesday, August 28, 2012

Questions I had when I was a Kid

In physics calculations, they use sin(x) = x for small x. Even if x is 1 degree, sin(1) is significantly less than 1. If x is very less than one degree, then it will not be of any significance. For example, for any calculations on a road which has some slope, my lecturer used this formula. If this formula does not hold good even for 1 degree, what is the use of that? The road having slope less than 1 degree is itself of no significance.

In sports, why most of the time, the first and second rankers face only in finals? If both face in the first round itself, that would give opportunity to others to reach finals.

When the father is more intelligent and knowledgable than child, why Grahm Bell's father did not invent the telephone?

In telugu/sanskrit, there is a comparison of a king and poet. It says that, when a king dies, one star fells. When a poet dies, one star appears in the sky. It claims that appearing in the sky has more significance. When a star fells after the death of the king, it signifies the impact that was created by the King. How can that be of less significance?

What I understood later on

x is not in degrees, but, it is in radians. If it is in radians, then it has some significance, and sin(x) = x can be used in practical problems for small x. I never had enough dare to ask my lecturer about this.

Generally the tournaments are conducted in such a way that, the winner is the one who can defeat everyone, and the runner-up is the one who can defeat everyone except the winner. Similarly the second runner-up is the one who can defeat everyone except the first two. If the tournament is not conducted that way, then there is no use of conducting that tournament. Because, except the first place, one can "fix" all other places. I understood this, when I got second prize in one tournament. If they had followed the real tournament rules, I would have been in 17th position out of 32 people.

"Father is intelligent than child" is applicable only for the first few years of the child, and the no.of years varies from child to child. After that, everything would change. Many people stop acquiring knowledge after reaching a certain stage. Depending on when they stop acquiring knowledge, there will be difference in the knowledge of the father and the child.

Eventhough a star falling down seems a major incident, it means, after that day, nobody would be aware of that star. When the star goes on to the sky, it means, from that day onwards, people would know about the star, and it will live eternal. In this case, nobody will remember the King after his death, where as everyone will remember the poet forever.

Wednesday, August 22, 2012

Law of Karma for Animals

In few philosophies, it says karma is applicable only to humans and not to animals. Since, the animals do not have thinking capacity.

In any place, if there are many dogs, and if a new dog comes to that locality, then all the dogs shout and send the new dog away, as if their government has registered that street to them. If they behave like this, is there any reason why the dogs have to be excluded from the law of Karma? If the dogs are included in the law of Karma, is there any reason why the other animals should be excluded?

Wednesday, August 15, 2012

Indian Independence - British Circumstances

During the world war - 2, Britain had spent lot of money. After the world war - 2, it became expensive for them to rule India. So, they gave Independence to India. For the same reason, they gave independence to Jordan in 1946, Palestine in 1947, Sri Lanka and Myanmar in 1948, and Egypt in 1952. For the same reason, France also had to grant independence to Laos in 1949, Cambodia in 1953, and Vietnam in 1954.

If there had been no world war - 2, and if Britain had not lost money, it would not have given independence to India for decades.

Even if Gandhi and other leaders of Congress had not done anything for Independence, still, Britain would have left India, purely because of financial reasons.