Essay 45 Write Code As a Last Resort

When residents of a New York City office building started complaining about the increasingly poor service of the elevators, the building management brought in a consulting firm to pinpoint the problem. The firm concluded that long wait times were the issue. Solving the tenant’s complaints meant potentially adding new elevators and implementing new computer controls to improve elevator efficiency. These would be very costly adjustments.

Enter the young psychologist hired in the building’s personnel department. He recommended, instead, placing mirrors in the elevator lobby. The problem wasn’t waiting times; it was boredom.

His suggestion worked. People stopped complaining about waiting for the elevator when they had something to do: observe themselves in the mirror. The same problem was solved with a very different solution.

The most passionate of us are the ones who spend most of our work time thinking critically and creatively, often to find simpler, “lazier” solutions. The answer isn’t always to plow ahead with the obvious, brute-force solution of writing more code.

Sometimes the best answers are found somewhere else. Ask yourself the following questions the next time you’re confronted with a New York office building elevator problem:

  • Has someone already done this task before? Can I use off-the-shelf code to take care of the dirty work for me?

  • Is this piece of functionality really important to the goals of the application? Is the task already there but just through a different user experience?

  • Is there a simpler way to code what I’m coding right now that might be worth the trade-off, even if it doesn’t solve the problem entirely?

  • Can I automate this task? Can I write software to write this algorithm for me so I don’t have to repeat this work?

When we go straight into “writing code” mode at every task, we lose the opportunity to think about why we’re really writing it. Instead, if we think critically about why we are writing code, we get to spend most of our programming time on the things that really matter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset