Friday, July 13, 2007

Lesson in Programming on Western Railway - Capacity problems, look beyond compression

A general manager of Western Railway made the effort to quickly increase the capacity. He introduced train coaches which had very few seats and, hence, a much larger standing capacity. It seemed reasonable that many more people could fit into each coach. The coach looked like a typical metro or subway train coach with seats on the sides and standing room in the middle. Except that these coaches were much wider and standing in them in crowded conditions was a torturous experience.
The congestion on the platform did not get any less. I avoided such a train, preferring to wait. The GM carried out a survey in which people said that they would accept such coaches if they were air conditioned.
The coaches were not airconditioned, rather they were withdrawn. I am pretty sure people, especially children, could have suffocated in such coaches. It would no longer have been lossless compression.

Wednesday, July 11, 2007

Lesson in Programming on Western Railway - Don't add a feature till needed

I had to go to a formal meeting and dressed in a tie. The train in Borivli was crowded as usual but getting down at Bandra was worse than I expected.
The rush of people trying to get in made exiting a very difficult exercise. I got down but my tie got entangled. Fortunately, only my shirt and tie were twisted out of shape.
It was, but, a valuable lesson. After that, the tie was always in my pocket and not on my neck till I was out of the local train.
The habit became so strong that I try not to program even a line till it is needed.

Tuesday, July 10, 2007

Lesson in Programming on Western Railway - Exception Handling

Even after over 30 years, some of the memories of traveling in Western Railway of Bombay suburban are very vivid. Some of these experiences have made me conscious of a number of critical programming concepts.
For example, exception handling is a must. If you can't handle a problem, pass it to someone else who can.
I was returning home and crowd was the usual size. We try to rush in and, hopefully, into the compartment so that we are not hanging from the door.
I try to get in from the left side of a pole in the center of the door. I suddenly find that a fellow passenger is trying to get in from the right side of the pole. Nothing wrong with it except that his arm is going around my neck. Neither can get on board and the harder he tries, the worse my condition.
To this day I cannot figure out how such a configuration occurred; but many problems in a multi-threaded application do not make any sense either. For a few seconds, I was sure that this was the absurd end to my life. However, other passengers realizing the deadlock, made the other passenger release his grip and I could board the train and then so could he.
I did not get an apology. Did not expect it either. I was just grateful for the release.