Tuesday, September 29, 2009

Improving Code Performance

Have you ever been told by a fellow programmer or by someone else that they are rewriting your code cause its dead slow and sucks.
Goshhh!!!


I know you cant resist looking into it no matter how worse the conditions may be with you.
No die-hard programmer or a self-respecting progrmmer is going to accept this.
I believe It's a phenomenon that I've noticed even in myself.
Cause its just not possible...

Yes that's impossible!!! leaving everything you head to office after all its not just a code its
"Your Code, Your identity the inner you" :D


You know that piece of code cant be faster cause it have the best code practices , implementation approaches , sorting algorithms , data structures and all that you have been taught or you are learning since those good BASIC days.
And here's the kewl response!!



Voila what this guy is doing here :D
And the worst part is here.


In the end this is what a self respecting programmer feels. :D



-------
---------------------------------------------------
But on a serious note ,
For me nothing motivates like having another programmer tell you they're rewriting your code because it sucks.And i think that this is the best way to motivate programmers and to improve productivity. but only if the competition stays healthy once it starts getting worse then it works just opposite.

Sunday, September 27, 2009

Line of fire!!

Today i was just checking my older mails and stumbled onto this story.
Can't resist posting this!!
Here it goes...

Mr. Vivek Pradhan was not a happy man. He was the project manager and still not entitled to air travel. It was not the prestige he sought, he had tried to reason with the admin person, that it would be time savings. He opened his case and took out the laptop, determined to put the time to some good use.
'Are you from the software industry sir,' the man beside him was staring appreciatively at the laptop.
Vivek glanced briefly and mumbled in affirmation, handling the laptop now with exaggerated care and importance as if it were an expensive car.
'You people have brought so much advancement to the country, Sir. Today everything is getting computerized.'
'Thanks,' smiled Vivek, turning around to give the man a look. He always found it difficult to resist appreciation.
'You people always amaze me,' the man continued, 'You sit in an office and write something on a computer and it does so many big things outside.'
Vivek smiled deprecatingly. Naiveness demanded reasoning not anger. 'It is not as simple as that, my friend. It is not just a question of writing a few lines. There is a lot of process that goes behind it. It is complex, very complex.'
'It has to be. No wonder you people are so highly paid,' came the reply.
This was not turning out as Vivek had thought. A hint of belligerence crept into his so far affable, persuasive tone. 'Everyone just sees the money. No one sees the amount of hard work we have to put in. Let me give you an example. Take this train. The entire railway reservation system is computerized. You can book a train ticket between any two stations from any of the hundreds of computerized booking centers across the country. Thousands of transactions accessing a single database, at a time concurrently; data integrity, locking, data security. Do you understand the complexity in designing and coding such a system?'
The man was awestruck; quite like a child at a planetarium. 'You design and code such things'.
'I used to,' Vivek paused for effect, 'but now I am the project manager.'
'Oh!' sighed the man, as if the storm had passed over, 'so your life is easy now.'
This was like the last straw for Vivek.
He retorted, 'Oh come on, does life ever get easy as you go up the ladder. Responsibility only brings more work.. Design and coding! That is the easier part. Now I do not do it, but I am responsible for it and believe me, that is far more stressful. My job is to get the work done in time and with the highest quality. To tell you about the pressures, there is the customer at one end, always changing his requirements, the user at the other, wanting something else, and your boss, always expecting you to have finished it yesterday.''My friend,' he concluded triumphantly, 'you don't know what it is to be in the Line of Fire'.The man sat back in his chair, his eyes closed as if in realization. When he spoke after sometime, it was with a calm certainty that surprised Vivek.
'I know sir. I know what it is to be in the Line of Fire'.He was staring blankly, as if no passenger, no train existed, just a vast expanse of time.'There were 30 of us when we were ordered to capture Point 4875 in the cover of the night. The enemy was firing from the top. There was no knowing where the next bullet was going to come from and for whom.In the morning when we finally hoisted the Tricolour at the top only 4 of us were alive.'
'You are a...?'
'I am Subhedar Sushant from the 13 J&K Rifles on duty at Peak 4875 in kargil. They tell me I have completed my term and can opt for a soft assignment. But, tell me sir, can one give up duty just because it makes life easier. On the dawn of that capture, one of my colleagues lay injured in the snow, open to enemy fire while we were hiding behind a bunker. It was my job to go and fetch that soldier to safety. But my captain sahib refused me permission and went ahead himself. He said that the first pledge he had taken as a Gentleman Cadet was to put the "Safety and Welfare of the Nation foremost followed by the Safety and Welfare of the Men" he commanded and his own personal safety came last, always and every time.'
'He was killed as he shielded and brought that injured soldier into the bunker. Every morning thereafter, as we stood guard, I could see him taking all those bullets, which were actually meant for me. I know sir. I know what it is to be in the Line of Fire.'Vivek looked at him in disbelief not sure of how to respond. Abruptly, he switched off the laptop.It seemed trivial, even insulting to edit a Word document in the presence of a man for whom valour and duty was a daily part of life; valour and sense of duty which he had so far attributed only to epical heroes.
The train slowed down as it pulled into the station, and Subhedar Sushant picked up his bags to alight. 'It was nice meeting you sir.'
Vivek fumbled with the handshake. This hand had climbed mountains, pressed the trigger, and hoisted the tricolour.
Suddenly, as if by impulse, he stood up at attention and his right hand went up in an impromptu salute.It was the least he felt he could do for the country.
--------------------------------------------------------------------------
Cant describe what i felt after reading this.
All i have is a Salute.
A salute to subhedar sushant and to every soldier of the nation.
-------------------------------------------------------------------------
Lets learn to live humbly, cause there are great people around us.Lets learn, true winners are " too busy to be sad, too positive to be doubtful,too optimistic to be fearful and too determined to be defeated"

Friday, August 21, 2009

Still in office!!

Finally the big day has arrived-- I decided to create a blog :).

After searching and analyzing some blogging sites i selected this one (Reason : my manager's blog is also here ;).
But just right after selecting a template and a theme for this i was completely stuck ; what to write in about me section ?? how to describe myself ??
And every time i started it all over--- i had the term Software Engineer dominating me.

The only things that came to my mind were -list of technologies, languages ,frameworks , number of projects-----my blogs, my social networking profiles , instant messenger addresses , my email id's, video channels and all those things which put my identity as a software engineer.

Then a silent thought came into my mind "....hey is this what you are and what you really love ??" and then a discussion with my mind.

my mind: Do you really love being software engineer ?

Me: Yes y not i have always loved coding and its the best thing is "my hobby is my profession".

my mind: Cool , but how about your other hobbies-- you love to sing right??

Me: Yeaaa i like singing but i am not so good at that.

my mind : How about your guitar . you play it fairly well , remember that day you played sajni with Raman ??

Me : Yes its my hobby and i love to play jal. But i can't make it profession. And when it comes to coding --Coding was my first love .

my mind: Are you sure.. You start singing when you were seven or eight. And Coding----I guess first language you learnt was basic and that was when you reached your sixth standard.

Me : Whatever?? I am a software engineer and i love it.

my mind: Okay but being a software engineer you are losing all what you loved .

Me : That's fine everybody makes compromises.

my mind: So you can compromise anything against your job.

Me: Depends -------------------

my mind: Depends as in?? You don't pick up your frnds call when you are busy.

Me: Frnds are okay. i call them when i am free.

my mind: How about your girl frnd ?? She's always waiting for your call .

Me: But she's the first one whom i call when i get free.

my mind : And you are free once in a day.

Me: ------------------------------(deep silence).

my mind: How about ur parents?? They are so alone now ...don't you miss them.

Me: yes i do.......

my mind: So last time you called them was .........yesterday.....or days back .

Me: (deep silence)

my mind: Lets talk about yourself. So you got a new guitar. Yamaha ESP cool

Me: yea its electric and looks so sexy.

my mind: yeaa but remember when you played it last time.

Me: (deep silence)

my mind :So its a waste of money. Your one month salary went into it.

Me: Ill play when i'll have time.

my mind: Okay you'll call your parents when you will be free. You'll play your guitar you'll have time. ...................................When ??

Me : When my project will get over.

my mind: Project..................(lolz). So your project will decide at what time you should do what.
Tell me one thing did your project decided at which school you should go, what dress you should wear, what you should eat, what you should do .

Me : What i didn't get you.

my mind: Is your project so important. Is it important than your parents.......or say your girl friend.

Me: Hmmmmmm......no...

my mind: Dont seems so...

Gaurav.......Synchronization has failed. Please look into the issue.

I woke up from this when one tester came to me and reported this issue.

In fact my mind was right i don't have time even for myself.

Chalo.. Will write back after fixing this issue.......

P.S : Its 1:00 am and i m still in office