Wednesday, 7 July 2010

The power of “NO”

There are a lot of people who can’t say NO; to just about anything. Even if it hurts them personally.

In one of my previous companies I attended a training on Personal Effectiveness. It covered different personality traits. They discussed about a concept called C.O.R.E. In an exercise they evaluated the attendees using a questionnaire. I was declared a person with a dominating “E” trait. Everyone has a dominating trait and certain other supporting traits. Later on they seated the attendees based on their dominating traits starting with C. Obviously I was in the last row. But, the most important point is that in a class of 20 there was only 1 guy who sat with me on that last row. I knew I am kind of insane but I didn’t know the extent. Before I started to feel lonely, the trainer started explaining things about the concept. Normally I remember all the humiliations and insults I go through but, this is kind of exceptional. I do not remember what the acronyms C, O, R and E stand for, but I remember what he said about E. Well, later on it turned out that E people are more humane than other people, so I was happy!

E people can’t say NO. They want everybody around them to be happy. So much so that they care about the opinions of a strangers too. They try to be modest and ensure that they always leave a good impression. They like to make friends in the group. They get disturbed if they said something bad (even if it was the need of the hour). They can’t do routine stuff. If traits like perfectionism is also present these people are a perfect fit. They ensure a good healthy environment and get things done efficiently too! But, the biggest worry is that the points that go in favor are points that go against them. The fact that they can’t say NO, from the organization point of view, these people are effective but they always are flooded with work. They like to please people that’s why they can’t take tough decisions – and that’s one of the reasons they like to work alone so that nobody interferes and nobody gets hurt!! Wonderful!

However, the other extreme is also present and its abundant. The people who say NO to everything. The first word they utter after a discussion is over and if you asked him – they will say NO. These people are “C” people. They like to do routine stuff. They never take chances. They are conservative and resist change. Unlike E guys who like to try and work out new things, they will act a laggard and stay away from new things and try only when they are asked for or mandated to do so. You can easily figure them out in a conversation, and judge how they will react to a situation. In any conversation or discussion they are mostly on the opposing side.

Its often said that its easy to criticize than to support – its because of these people. The pointers that go against them are the same ones that work in their favor. The fact that they resist change is the fact they bring stability to the organization. They bring the other aspect of the conversation strongly, and most importantly they never lose money in recession – because they invest in Fixed deposits and debt instruments than equity based instruments :) These are the people who survive bad times because of the power of NO.

There is nothing like right or wrong or good traits or bad traits. Everything in this world is relative. The people who let the correct trait dominate according to the given circumstance are winners eventually.

Friday, 2 July 2010

What’s in the name?

Let’s take a step back. Alright, several steps back. When you started reading this, did you get excited by the fact that you will learn something new? It will be fun? No, you thought its just another blog talking about some other weird misnomer (go get a life, watch 3 Idiots!).

If you like the practice of software engineering – you are most welcome. If you are not, then you are not wasting your time, read on, its fun. I am not as funny as a porcupine wearing a Li.Lo. (Lindsay Lohan – they say she likes girls! No big deal, even I do) red wrap-around, but you can try. Ever heard of adventure?

I thought of writing this when I was stuck in a traffic jam with all vehicles getting in way of the other – like a deadlock you know – you techie guy. But, I like saying all this (read shouting) to all those guys who are “accidently in love” (OST Shrek) with software engineering. I will call them coders from now on. These coders code for fun. Because, they make fun of coding. This is the first in series of my misadventures with coders. They have transformed me into a very calm and composed person. I am thankful to them.

I am also a coder. I like to be like this for many more years to come because I am in love with coding. Its a different matter altogether that my definition of coding captures architecting, then designing, then developing, then unit testing, and finally delivering to business with agile-ity.

We will talk about other aspects later, but for now I am concentrating on the greatest myth of all – naming the variables.

What the F. is in the name? It doesn’t matter, does it? My dear numbnuts, it does. People who care about it have written books on it. Go fetch.

Alright, tell me what could be wrong a variable names like: “strString”, or “intInt”, or for the imaginative few “iInt”, or for the pseudo-coders “strName”? Did I forget to mention i, x, y, k etc. What about F? What’s wrong in specifying the data type along with (data type?), something! Concentrate on the functional aspect of the variable not on the data type - see what it does, don’t stress on what it is. Its meaningless isn’t it? What about trying names like “firstName”, “lastName” or “totalFiles” for a change?

People try and be imaginative and use names like “m_strName”, “p_intAge”, or “g_oSessionObject” – they are just trying to attach scope of the variable with their names. No big deal. You ain’t doin’ structured programming are you?

Some of them use names like “Form_Collection.cs” in a windows application to name a Windows Form, and “Form_Collection.aspx” in a Web application. You will find all files in their solution explorer with that redundant “Form_”. Why is that? Will it become an “edmx” if you do not prefix “Form_”? Redundant, agonizing.

Some choose to use names like “TCImpersonator” or “TCComputerManagement” for their classes (kudos to them that they created one). “TC” was the name of the application. Namespaces anyone?

So, you see the different trends and patterns in naming. Mind you that I have worked in about 5 to 6 different companies, most of them very huge enterprises, and the story is same everywhere. Nobody takes this aspect of programming seriously. One of my colleagues declared that some “jobless person is given a task to create some guidelines” – they don’t even give a damn to it. But, let me tell you its very important. Its as important as a brick is to a building or a friend is in facebook.

Would you like to hear a person talking about hygiene and cleanliness if he doesn’t even use water to clean his donkey (try a synonym)? Now, do you understand where I am going? It all starts with this. If a coder is not convinced about keeping his variable names under check how can you expect him to try and understand concepts like “Separation of Concerns” and “n-tier” architecture? Even if they do theoretically understand, they will hesitate to practice it. The result is smelly, redundant spaghetti code.

The true takeaway of this post is to make my fellow coders understand the fact that keeping things simple and following patterns and practices is like “a stitch on time saves nine”. I know the fact that deadlines, peer pressures, and sometimes biased guidelines takes a toll on us, but that shouldn’t stop us from writing good, human readable code. Although machine executes it, but there is a reason why C# or any other high level language is in English not in binary. Leave your Visual Basic and VC++ 6.0 days behind you, be pragmatic, be objective, and be functional. Start now, its not that difficult, and you will see how your confidence develops, and you too can be cool!

Don’t listen to what I say, just give it a thought, and try the following links, and you will know what’s good and what’s not.

Naming Guidelines