Wednesday, May 30, 2012

Leaves and Leaders

I have heard of few leads/managers who do not accept the leaves of their team so easily, even if they are given sufficient advanced notice.

One reason for this is, the team member is indispensable, and if he/she leaves, the project cannot proceed till he/she comes back. The lead cannot lead till then. So, they reject the leaves. If the team member has to go at any cost, then they may leave, even if the leave is not approved. In those cases, few leads escalate these issues to higher management.

I did not understand for a long time, why these leads unnecessarily escalate these issues to higher management. The time won't come back. Even if they escalate, next time, when the team member has to go on leave in emergency, they won't stop. The lead would be just spoiling the relationship with the employee. Instead, if the lead praises the team member how important he/she is to the team, and how indispensable he/she is, then the team member would get more enthusiasm, and would try to do something, so that, the project won't fail.

Later, I realized that, these things are used by leads/managers to pass the blame on to the team member. If the project fails, then the lead or manager immediately say that, since this team member went on leave without approval, the project failed. The lead says, he/she cannot deliver the project, when he/she does not know when the team members leave without any notice.

In many service based companies, the team members shuffle frequently. So, even if the relationship is broken, the lead/manager do not care about it.

Of course, if these "so called" leaders get opportunity to work with people like me, everything would be set straight. ;)

If the leader is not ready to take 100% responsibility for the failure, then he/she is not worth of being called as a leader.

Thursday, May 24, 2012

I Don't Want to Work on Bug Fixes

Many people think that, fixing bugs is inferior work, and many people try to avoid it.

Many people forget that, the quality or greatness of the work is not in the work itself, but, how the people make out of it.

Recently, I got an interesting bug. The bug is very simple. It is a Null Pointer Exception. If that bug is given to any fresher, who has little programming knowledge, they can fix it in five minutes, and it will pass the testcase. But, I took lot more time.

When I had written the code, I assumed that, it won't return null, and coded accordingly. Now, when I got null, I checked why it is returning null. I found that, the corresponding Dictionary has not been populated. It was not populated, because, DB was not returning it. When I checked, what DB is returning, I found that, when the input has 600 ids, DB is returning only for 200 entities. The issue is, the stored procedure's input parameter can hold only 200 ids. Increasing the size of the input fixed this issue.

But, this is not the final solution. The null exception is coming even for basic scenarios. In basic scenarios, it should not be processing hundreds of entities. When I checked, why it is processing that many entities, I realized that, at one place, where it has to update it's dependents, it is updating all the entities in that component. When I am creating a new entity, it won't have any dependents. But, since, it is taking all the entities in the component, it is trying to update all the entities in the system.

My final fixes were, changing the code to update only it's dependents, and increasing the size in the stored procedure. I did NOT add null check in my code. If I get null again, it means, there is some big issue somewhere else.

If I had just added null check in my code, it is very difficult to find the issue, because, this entity would be updated properly. This failed in an asynchronous job. So, it is very rare that, as part of this testcase, tester tests other entities which are not involved with this entity. While executing the testcase for dependents, if the component does not have 200 entities, then that also would pass.

There is no work that can be done by the less qualified people. It is just that, we do it like the way less qualified people.

By the way, since, that Null Reference exception came in my code, I did more investigation. If it had been in other's code, even I would have finished it in five minutes. ;)

On a different note, my lead told me to put the effort spent for bug fixes in hours and not in minutes. I don't know how he felt, when I said, I am putting effort in hours only.

Friday, May 18, 2012

Why Should I be Kind to Everyone?

One person stands at the entrance in a train, does all kinds of feats and boards/gets down the moving train in every station. If he gets hurt by that, Why should I be kind to that person?

One person drives bike very rash and fast in a busy location without helmet. If he falls and gets injured, why should I be kind to that person?

When the people vote for bad candidates in the elections, and then suffer for their problems, why should I show sympathy to them?

One person cheats another person, and the second person suffers a lot because of that. After some time, if the first person suffers in the same way the second person suffered because of his action, Why should I be kind to that person?

People like Mahathma Gandhi have distorted the Hindu principles a lot. He says, one should show compassion to everyone. He removed the phrase, if they deserve.

Yama, the lord of death and punishment, is a great devotee of Lord Krishna. He is one of the 12 maha bhagavathas (The authorized people to preach about the Lord Krishna). If we go by the definition of Gandhi, then Yama can never be a great person.

Only the very fortunate people gets the punishment for their mistakes in the same life.

Saturday, May 12, 2012

Political Illiterate

The worst illiterate is the political illiterate. He hears nothing, sees nothing, takes no part in political life.

He does not seem to know that the cost of living, the price of beans, of flour, of rent, of medicines, all depend on political decisions.

He even prides himself on his political ignorance, sticks out of his chest and says he hates politics.

He does not know, the imbecile, that from his political non-participation comes the prostitute, the robber and, worst of all, corrupt officials, the lackeys of exploitative multinational corporations.

- Bertolt Brecht

Taken from Occupy Together

Tuesday, May 08, 2012

Design of Web Service Vs Performance of Client

Long back, I was working on a desktop application which handles lots of data. That application connects to a web service to get the data. Once the data is downloaded, the user works on the data offline, and then uploads the updated data.

One fine day, I got a mail from the web service team that, I was using one web service call which gets the data for all the entities in a given component. They were planning to remove that web service, and asked to me to use two other web service calls. First web service gets me the ids of all the entities in the given component, and the second web service gets me the data for a given entity. So, I need to call the first web service and gets the ids of all the entities, and for each id, I need to call the second web service to get the data. If there are 100 entities in the component, then there would be 101 web service calls. The reason that they gave for this change was, the web service was taking lot of time, and taking lock on SQL Server for a long time, which is blocking other transactions.

As usual, I did not agree with their proposal. My arguments were,
  • There will be too many web service calls from the client to the server. Performance of the client would go down.
  • The performance of the server also would go down. If they have single stored procedure/web service, the server would do much less work than 100 web service calls/stored procedures.
  • If they are worried about SQL Server taking locks, they can have another wrapper web service which does all this work, and send it to the client, so that, client does not need to worry about the changes in the server.
Their arguments were,
  • The stored procedure for the original web service is very expensive, and taking huge time to execute. Till then, it is holding the lock and other transactions are blocked till that time.
  • Eventhough, with the proposed changes, the performance of this operation would go down, but, overall performance would increase, because, other transactions would not be blocked for a long time.
  • All the web service calls map to a stored procedure in the DB. Creating another web service which does not have any corresponding stored procedure does not look good. This would be the only web service call that would be odd, and they do not want to pollute the web service.

Till, I was in that project, I have not done what they had asked. I don't know what happened, after I moved out of that project.

Who is wrong in this case?

[Of course, even if you say that, I am wrong, I may not accept. Because, I still feel that, Webservice should be driven by the requirements of the user rather than the DB design.]

Wednesday, May 02, 2012

Discrimination Based on Sex, Caste and Religion

Two people (one guy and one girl) contact me once in a while, for any help required in their application.

Whenever the girl asks for help, it is done in 5 mins to 5 hours. Only once, it went beyond that.
Whenever the guy asks for help, it is done in 5 days to 5 weeks. Only once, it is done in less than 5 days.
Nobody has criticized me directly on this. But, it is quite possible that, they think, I am discriminating based on sex. 

Whenever the girl sends me an email for any help, she puts the entire information that she has in the email. If the information is huge, she dumps everything in a document and attaches that document.

Whenever the guy sends me an email for help, he puts enough information required for any user of that application. He does not put any redundant information and does not attach any extra documents so easily.

If I have any follow up questions, both would respond within one working hour.

In general, if there is any attachment, generally, I won't open it immediately. I would open it later, whenever I am free. Even by this logic, I should be more responsive to the guy rather than the girl.

Unfortunately, people underestimate/ignore many many small things which can change everything. The small things matter a lot in the real world, and if everybody concentrates only big things, we can never develop.

I am very lazy and busy. I am neither a user nor a developer of that application and I don't know the technology that is used in that application. It is developed by a less qualified person, and I am just maintaining it. If I want to do even small change in that, I have to spend lot of time for that. In such a situation, whoever is asking for help, I would be happy to get as much data as possible. When the guy sends the information, he sends enough information for the user of that application. But, I am not a user. So, I need more details. I had to follow up with that guy multiple times.

How exactly one can go to the screen that he is referring? Once I reach that screen, which user should I chose to test? What all operations can I perform on that application so that, their data is not modified? These are all obvious for any user of that application, but not for me. So, I had to follow up for each of those things one by one, because, I discover the second one only after the first is clarified. I generally work on these things at night or weekend, and he won't be available immediately to answer at that time. So, I get the response next working day. Each follow up would increase the time significantly. The general tendency is, if I had to spend more time and follow up many times, then I would delay it more. For example, if I followed up for four times, for first follow up, I may reply in one day, whereas for the fourth follow up, I may reply only after a week.

Once that task is done, after few days, he asked me to do some other change at some other place. By then, he deleted the test user. So, I had to follow up again to create the test user. After doing that, then he said, the same thing has to be done at other places. If he gives the entire information with detailed steps on everything, and asks me to solve it, then, I can spend least amount of time and get it done.

First time, when the girl sent me a big attachment with so much information, I got bewildered. But, when I started doing that, I never needed anything extra, and in one single sitting, I finished everything that she asked. Even for small things like, application is down, she sends full error message that she gets, eventhough, I could find it myself. That would save me few seconds, and I can directly login/open appropriate application/server to fix the issue.

Whenever she sends any mail to me, she does everything she could do, and spends a lot of time in composing the mail with all the information. She communicates to me in such a way that, my time is very valuable, and she tries to use minimum time of mine. Whereas, it is the exact opposite with that guy.

I respond faster to those who give more value to me and my time. I also expect, if they want to solve their problems, they should have more interest in solving their problems than me. Otherwise, I won't respond that much faster.

In towns and villages, many times, people of different castes talk in different ways with others. Few caste people may talk to others always in singular, and few other caste people talk to others always in plural. If somebody asks me a favor without giving respect, I would show minimum interest in solving his/her problem. But, if they give minimum respect, then I may spend time to solve their problems. If only one particular caste people give me respect, then it would look like, I discriminate based on caste, and help only that particular caste people.

I discriminate based on how much the other person values me and my time. If only particular sex, caste and religion people values me and my time, then one can assume that, I discriminate based on sex, caste and religion.