Punjabi By Nature
Punjabi by Nature

Sounds of silence

Hello Darkness, smile old friend....
I have come to talk to you again...

Simon & Garfunkel..

Because most aircraft accidents happen during takeoffs and landings—the most hectic and coordination-intensive parts of any flight—the industry has imposed a rule called the “sterile cockpit”. Anytime the aircraft is below 10,000 feet—whether on the way up or the way down—no conversation is permitted, except what’s directly relevant for flying. At 11,000 feet, you can talk about football, your kids, or the loathsome passengers. But not at 9,500 feet.

In an organization, the IT group jointly agreed on a sterile cockpit for their software project. The group had embraced a substantial goal—to reduce new product development time from three years to nine months. In previous projects with tight deadlines, the work environment had become increasingly stressful, and as workers got behind schedule, they’d tend to start interrupting their colleagues for quick help. Managers would wander by regularly to be “statused” on the project. As a result, people were interrupted more and more, and work weeks expanded to 60 and 70 hours as people started showing up on the weekend, hoping to get some work done when they could focus.

The IT group decided to try an experiment—they established “quiet hours” on Tuesday, Thursday, and Friday mornings before noon. The goal was to give coders a sterile cockpit, allowing them to tackle more complex bits of coding without being derailed by periodic interruptions. Even the socially insensitive responded well to the change in the Path. One engineer, previously among the worst interrupters, said, “I always used to worry about my own quiet time and how to get more of it, but this experiment made me think about how I’m impacting others.”

In the end, the group managed to meet its stringent nine-month development goal. And the division VP attributed the success to the sterile cockpit quiet hours: “I do not think we could’ve made the deadline without it,” he said. “This is a new benchmark.”

In these disparate environments—cockpits and hospitals and IT workgroups—the right behaviors did not evolve naturally. Nurses weren’t “naturally” given enough space to work without distraction, and programmers weren’t “naturally” left alone to focus on coding. Instead, leaders had to reshape the environment consciously. With some simple tweaks to the environment, suddenly the right behaviors emerged. It wasn’t the people who changed, it was the situation. What looks like a people problem is often a situation problem.

 del.icio.us  Stumbleupon  Technorati  Digg 

Save our tigers

Aircel has launched an initiative called www.saveourtigers.com

Its really laudable. As a group, I have always seen them innovate and go that extra step.
I hope that something good comes out of this initiative.

On a side note, I have always wondered how do you mobilize masses who have daily chores
to do and put bread on the table to be senstitive and participate in largr causes.

Only 1411 left..

 del.icio.us  Stumbleupon  Technorati  Digg 

What am I reading

  • Edge Question:”How Has The Internet Changed The Way You Think?” Answers from some of the world’s best.
  • Start-ups need to Focus: by Ed Sim. “It is always hard for a startup to enter a market with an end-to-end product positioning as most customers expect large companies to cover this territory.  What most customers expect from startups is innovation and breakthrough offerings, not end-to-end solutions. “
  • Ambedkar’a Desiderata:by Ramachandra Guha in Outlook, on India’s 60 years as a Republic. His last para is telling: “The times we live in, and the expectations engendered by them, call for leadership that is rather better than mediocre. The men and women who now rule India—whether from the centre or in the states—seem concerned, above all, with survival: the survival in his present post of an individual politician; the survival at the apex of the organisation of a particular family; the survival in government of a particular party. To plausibly and successfully redeem the ideals of the republic, however, this shall not be enough.”
  • India’s Local Newspapers: from India Knowledge@Wharton. “At a time when newspapers are folding around the world, India’s media scene is admirably buoyant. Why? Many experts give credit to the country’s burgeoning rural, local-language newspaper business…But these publications face their own growth challenges, including India’s relatively low literacy rate, poor infrastructure and the increasing penetration of television in rural areas.”
  •  del.icio.us  Stumbleupon  Technorati  Digg 

    What am I reading?

    Happy New Year!!!

    Here is what I am reading....

    • Top 10 Mobile Apps of 2012: A look into the future.
    • How long can an unhappy India stay united? by Vijay Rana. “India’s warring politicians need to sit together to discuss these conflicting regional aspirations in a sensible and enlightened environment. We cannot continue to play political games of setting people against people, caste against caste and religion against the religion.”
    • Put down that Shovel! by Andy Kessler. “Forget old-fashioned infrastructure. Here are six government projects to foster a lasting economic recovery.” Ideas for the US, but that’s the kind of thinking we need for India also. 
    • The Year in Ideas: from The New York Times.
    • Ten ‘BreakOut!’ Business Ideas Of 2009: from Forbes. Among them: “Invisible speakers. Detergent-strength tap water. Landmine-sniffing rats. Instant whiteboards.”

     del.icio.us  Stumbleupon  Technorati  Digg 

    ToString() considered Harmful

    When I was studying, Dijkstra had this famous anecdote that "Goto" statements are considered harmful and hence should be conisdered illegal! (http://www.cs.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD215.html)

    I put forwrard a similar case for ToString(). Generations of programmers have been brought up to do ToString() without checking null and causes all kinds of harmful side effects long after the program is written.

    C# has given us a wonderful keyword called "as" which essentially encapsulates the following

    if(null != <your variable>
    {
       <another variable> = <your variable>.ToString()
    }

    So next time you are writing ToString() or toString() or another variant ... consider it carefully and use the above construct instead.
    It is also a good practice as part of Defensive Programming.

     del.icio.us  Stumbleupon  Technorati  Digg 

    Building a voice internet - Part 4

    Scenario
    Ram is an electrician operating in the Shivadaspur area in the Varanasi town. His expertise lies in fixing house-hold electrical problems of all kinds, except air coolers and air-conditioners. He cannot afford to have a shop of his own and his business depends on customers who know him by word-of-mouth. Recently, Ram bought a mobile phone, and started advertising his services in the Shivadaspur Yellow Pages. Since then, the business has started picking up. However, many a times, while on a home call on duty, he is unable to accept calls, and this often results in losing new customers and upsetting old ones. One day, he finds out about a Create-your-virtual-shop service offered by his Telecom operator, and decides to sign up. He calls up the advertised phone number and creates his virtual shop as a VoiceSite in a matter of minutes by talking to this voice driven system. He also specifies reference information about previous customers and links to their phone numbers. Now the customers trying to reach Ram land up at this virtual shop and schedule an appointment with him while he is serving other customers. In addition, he adds links to the virtual shops of his friends who can take up the job in the event that he is unavailable at the time specified by the customer. Seeing Ram’s increasing customer base, the electrical shop
    owner in his area requests Ram to include a link to the electrical shop’s tele-store (another virtual shop), where customers can place their orders which will be home delivered by the store. Customers can pay through their bank account or through one of the credit cards that have a tie up with store’s telecom provider. The payment happens safely through a voice driven interaction with the bank’s VoiceSite during the phone call, much in the same way as online transactions happen on the Web. This adds another customer facing channel for the electrical shop and adds to the services offered by Ram. Ram gets a percentage of the profits for customers reaching through his virtual shop and thus both Ram and the local store thrive with the use of Virtual Shop
    service.

    Scenario courtesy: Arun Kumar

     del.icio.us  Stumbleupon  Technorati  Digg 

    Elements of Programming Style

    With apologies to Strunk and White ...

    Why Bother?
    •A program is a sort of publication. It is meant to be read by the programmer, another programmer (perhaps yourself a few days, weeks or years later), and lastly a machine.The machine doesn't care how pretty the program is - if the program compiles, the machine's happy - but people do, andthey should.
    --Rob Pike

    This is a short list of notes from me on what should be the elements of well written programs

    Typography
    •Consistent Indentation
    •Consistent use of braces

    Comment the Code
    •Prologue
    •Epilogue
    •Every Logical Block

    Functions And Variables
    •Names conveys Semantics, not data types
    •Names should not be too short, or too long
    •Initialize ALL variables to default values

    Constants
    •Never hardcode constants in the code
    •Separate them out in a file or class

    Single Return Statement
    •Leads to more optimized code
    •Avoids subtle bugs
    •Easier to maintain code over time

    Error Handling
    •Use Meaningful Exceptions
    •Stick with one type of error handling

    Resource Management
    •Use garbage collectible (GC) resources
    •Finally block to dispose non-GC resources

    Refactoring
    •Continuously refactor your code
    •Small is beautiful … i.e. length of function

     del.icio.us  Stumbleupon  Technorati  Digg 

    Things that you should never do

    One from Joel's archives...

    We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by incremental renovation: tinkering, improving, planting flower beds.

    There's a subtle reason that programmers always want to throw away the code and start over. The reason is that they think the old code is a mess. And here is the interesting observation: they are probably wrong. The reason that they think the old code is a mess is because of a cardinal, fundamental law of programming:

    It’s harder to read code than to write it.

    This is why code reuse is so hard. This is why everybody on your team has a different function they like to use for splitting strings into arrays of strings. They write their own function because it's easier and more fun than figuring out how the old function works.

    As a corollary of this axiom, you can ask almost any programmer today about the code they are working on. "It's a big hairy mess," they will tell you. "I'd like nothing better than to throw it out and start over."

    Why is it a mess?

    "Well," they say, "look at this function. It is two pages long! None of this stuff belongs in there! I don't know what half of these API calls are for."

    Before Borland's new spreadsheet for Windows shipped, Philippe Kahn, the colorful founder of Borland, was quoted a lot in the press bragging about how Quattro Pro would be much better than Microsoft Excel, because it was written from scratch. All new source code! As if source code rusted.

    The idea that new code is better than old is patently absurd. Old code has been used. It has been tested. Lots of bugs have been found, and they've been fixed. There's nothing wrong with it. It doesn't acquire bugs just by sitting around on your hard drive. Au contraire, baby! Is software supposed to be like an old Dodge Dart, that rusts just sitting in the garage? Is software like a teddy bear that's kind of gross if it's not made out of all new material?

    Back to that two page function. Yes, I know, it's just a simple function to display a window, but it has grown little hairs and stuff on it and nobody knows why. Well, I'll tell you why: those are bug fixes. One of them fixes that bug that Nancy had when she tried to install the thing on a computer that didn't have Internet Explorer. Another one fixes that bug that occurs in low memory conditions. Another one fixes that bug that occurred when the file is on a floppy disk and the user yanks out the disk in the middle. That LoadLibrary call is ugly but it makes the code work on old versions of Windows 95.

    Each of these bugs took weeks of real-world usage before they were found. The programmer might have spent a couple of days reproducing the bug in the lab and fixing it. If it's like a lot of bugs, the fix might be one line of code, or it might even be a couple of characters, but a lot of work and time went into those two characters.

    When you throw away code and start from scratch, you are throwing away all that knowledge. All those collected bug fixes. Years of programming work.

    You are throwing away your market leadership. You are giving a gift of two or three years to your competitors, and believe me, that is a long time in software years.

    You are putting yourself in an extremely dangerous position where you will be shipping an old version of the code for several years, completely unable to make any strategic changes or react to new features that the market demands, because you don't have shippable code. You might as well just close for business for the duration.

    You are wasting an outlandish amount of money writing code that already exists.

    When programmers say that their code is a holy mess (as they always do), there are three kinds of things that are wrong with it.

    First, there are architectural problems. The code is not factored correctly. The networking code is popping up its own dialog boxes from the middle of nowhere; this should have been handled in the UI code. These problems can be solved, one at a time, by carefully moving code, refactoring, changing interfaces. They can be done by one programmer working carefully and checking in his changes all at once, so that nobody else is disrupted. Even fairly major architectural changes can be done without throwing away the code.

    A second reason programmers think that their code is a mess is that it is inefficient. The rendering code in Netscape was rumored to be slow. But this only affects a small part of the project, which you can optimize or even rewrite. You don't have to rewrite the whole thing. When optimizing for speed, 1% of the work gets you 99% of the bang.

    Third, the code may be doggone ugly. One project I worked on actually had a data type called a FuckedString. Another project had started out using the convention of starting member variables with an underscore, but later switched to the more standard "m_". So half the functions started with "_" and half with "m_", which looked ugly. Frankly, this is the kind of thing you solve in five minutes with a macro in Emacs, not by starting from scratch.

    It's important to remember that when you start from scratch there is absolutely no reason to believe that you are going to do a better job than you did the first time. First of all, you probably don't even have the same programming team that worked on version one, so you don't actually have "more experience". You're just going to make most of the old mistakes again, and introduce some new problems that weren't in the original version.

    The old mantra build one to throw away is dangerous when applied to large scale commercial applications. If you are writing code experimentally, you may want to rip up the function you wrote last week when you think of a better algorithm. That's fine. You may want to refactor a class to make it easier to use. That's fine, too. But throwing away the whole program is a dangerous folly.

     del.icio.us  Stumbleupon  Technorati  Digg 

    Building a voice internet - Part 3

    The phrase “voice internet’s” second word “internet” is as important as the first word. Till now I have been extolling the virtues of “voice” but what really happened in the textual and multi-media internet is the ability to link multiple applications via hyper-linking. Even more important was the ability to pass “context” and “parameters” to other applications. For e.g. you could be on Amazon site and you could be transferred to a payment site without losing context and data being pre-filled. Similarly with the advent of web-services you can integrate multiple applications programmatically with ease.

    Now contrast this with the current scenario in the voice applications world. All “voice UI” aka IVR applications are standalone applications essentially. They interact with a backend database or CRM or payment gateway systems but not at the voice level, rather at an application level.

    Why is this important you ask? 

    Consider an application in the travel domain.
    You call up a number say – 1-800-TRAVEL and want to find the cheapest fares across a number of travel sites and airlines. BUT, you do not want to book these tickets on this number, instead you want to book directly at the site which offers the cheapest flight. So, you call up this number and specify your details
    Starting city: Delhi
    Destination city: Mumbai
    Start date: Sep 28, 2009
    Return date: Oct 4, 2009

    The application searches for then lowest fares and finds it on Jet Airways. However, now you need to be transferred to the Jet Airways voice app, and there is no way for Jet Airway voice app to know that you are coming with the context of Delhi-Mumbai return flight. You have really no choice but to enter the details again. Ugly Ugly Ugly.

    I am open to suggestions on this and also looking for a solution. If someone knows anything please let me know, as I am designing my own solution to fulfill the promise of the voice internet.

     

     del.icio.us  Stumbleupon  Technorati  Digg 

    Building a Voice Internet - Part 2

    There is another set of standards called vXML (Voice XML) and ccXML (call control XML) that have also come on scene recently. Whilst these standards are useful in what they do, they are not really the answer to all the problems that face us. For example, when a vXML application is interacting with a speech recognizer, there doesn’t seem to be a clean way of specifying which grammar to use, especially when the grammar is big and you probably need just a “lever” to tell it to load a particular grammar, and not send the “entire” grammar over the wire. 

     

    The solution that I saw in a couple of implementations is that they passed out of band data or used some other handshake protocol to do this. Obviously this is less than a desirable situation to be in. If one has to leverage the full power of voice, then one has to do something more than just build standalone voice applications that have difficulty interacting with internal and external applications.

     

     del.icio.us  Stumbleupon  Technorati  Digg 

    Blog Software