A conversation of a software engineer in a train trip

July 26th, 2008

A real story …A gossip between a Solider and Software Enggr in Shatabdi Train ………An interesting and a must readl!

Vivek Pradhan was not a happy man. Even the plush comfort of the air-conditioned compartment of the Shatabdi express could not cool his frayed nerves. 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, it was the savings in time. As PM, he had so many things to do!!

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. The man was young and stockily built like a sportsman. He looked simple and strangely out of place in that little lap of luxury like a small town boy in a prep school. He probably was a railway sportsman making the most of his free traveling pass.

“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.”

For a moment, he was tempted to explain the entire Software Development Lifecycle but restrained himself to a single statement. “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. Indians have such a narrow concept of hard work. Just because we sit in an air-conditioned office, does not mean our brows do not sweat. You exercise the muscle; we exercise the mind and believe me that is no less taxing.”

He could see, he had the man where he wanted, and it was time to drive home the point.

“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 centres 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 awestuck; quite like a child at a planetarium. This was something big and beyond his imagination.

“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.”

Vivek paused in his diatribe, his belligerence fading with self-realisation. What he had said, was not merely the outburst of a wronged man, it was the truth. And one need not get angry while defending the truth.

“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 Subedar 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… ….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 Subedar 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.

PS: The incident he narrated during the capture of Peak 4875 is a true-life incident during the Kargil war. Capt. Batra sacrificed his life while trying to save one of the men he commanded, as victory was within sight. For this and various other acts of bravery, he was awarded the Param Vir Chakra, the nation’s highest military award.

Live humbly, there are great people around us, let us learn!

BE POLITE… EVERYONE U MEET IS FIGHTING A HARD BATTLE

P.S.: I received this story through an email, just couldn’t resist myself from sharing it with the world of software engineers :)

Nice article on Concurrency in .NET

July 21st, 2008

He will give a motivating usage example and explain how it relates to other concurrent constructs.

There are three key concepts that .NET concurrency primitives relate to: concurrent execution, synchronization and memory sharing.

Here is the complete article.

Roadmap to Understanding and Implementing Garbage Collection in .NET

May 17th, 2008

Excellent set of links that can give any .NET developer roadmap to understanding how .NET CLR implements Garbage Collection.

Also few articles that will show how to program so as to improve application’s memory use and performance.

Click Here for Garbage Collection Articles

Limit upload or download bandwidth usage with Traffic Sharper XP

May 12th, 2008

Traffic Shaper XP is a free bandwidth limiter for Windows 2000, XP and 2003 Server. It combines high performance traffic shaping with the ease of use and flexibility to keep your network free of congestion.

It is a very nice tool for developers to test their pages or particularly file upload on lower bandwidth connections.

It’s possible to customize IP address and port number for source and destinations both. It’s good for testing use.

Another good news is that it’s a free bandwidth limiter tool.

Go! Go! Go! for download.

Amazing Computers, IT and Programming Jokes

May 9th, 2008

I just came across amazing bunch of jokes on this page.

Must read for any programmer! Fun to read if you are in IT Industry.

http://www.devtopics.com/best-programming-jokes/

Http Handler and Http Module in ASP .NET

May 3rd, 2008

Http handler processes the request to generate an output sent out in response to the request.
The most common one is ASPX page handler that processes all .aspx requests to asp.net application.
Http module is an aseembly that is called on every request to an asp .net application. They have access to life-cycle events through asp .net request pipeline.  Http modules let you examine incoming and outgoing requests and take action based on the request.

Http Handler can be developed to render rss feeds for all .rss requests or an image server which serves various size images.

Httm module can be developed to do security check for every single request to application before any handler is called to generate the response.
Http module is useful in statistics and logging because it’s called for every type of request. We can manipulate header/footer information of every request using http module.

One can develop Http module by implementing IHttpModule interface while Http handler using IHttpHandler or IHttpAsyncHandler.

More about HttpHanlder Implementation

Both handler interfaces(IHttpHandler and IHttpAyncHandler) requires you to implement IsReusable property and ProcessRequest method. Is Reusable property specifies whether IHttpHandlerFactory object(the object that actually calls appropriate handler) can put the handler in a pool and reuse it to increase performance. If it’s a requirement to have new instance of handler every time, this property should be set to false.

ProcessRequest method has the code to generate the output for the handler.

HttpHandler have access to Application Context.

If you are creating a handler for requests with .abc extension, you must map them in IIS to ASP .NET. Then in application’s web.config file you must map the extension to your http handler.

More about HttpModule Implementation

Http modules let you examine the incoming request to take action on it and also the outgoing response to modify it.

Httpmodules are similar to ISAPI filters in IIS because they are called for every request.

ASP .NET itself uses modules to implement various application features like forms authentication, caching, sessino state, and client script services.

When ASP .NET creates an instance of HttpApplication class, instances of any modules that have been registered are created. When a module is created, its INIT method is called and the module initializes itself. 

In a module’s Init method, you can subscribe to various applicatin events such as BeginRequest and EndRequest by binding the events to the methods of module.

When application events are raised, the appropriate method in your module are called. During this event handling the module has access to Context property of the current request which is an instance of HttpContext class. This enables you to redirect the current request, modify the current request or perform any other request manipulation.

You should add code in the Global.asax file whenever you must create code that depends on application events and you do not have to reuse it across applications. You can also use the Global.asax file when you have to subscribe to events that are not available to modules, such as Session_Start and Session_End.

Difference between stack and heap memory area

April 30th, 2008

The value types are allocated memory in the stack area.
(bool, byte, decimal, char, enum, uint)

The reference types are allocated memory in the heap area.
(class, interface, delegate, object, string)
Though, pointers to the reference types are stored in stack area.

Value types declared in a method body/instructions will go into the stack area. But, if the value type is declared withing a reference type, it will get memory allocation in heap area only.
When a method finishes executing all its members/variables are removed from the stack. So we also lost the pointers to reference types used by this function. So now the reference type is orphan in the heap area. This is taken care by GC to get rid of it.

Excellent article here that explains the same thing with examples, here.