Programming magic: Rituals and habits of effective programmers

By Amy Bennett, ITworld |  Development, programming Add a new comment

When a baseball player steps into the batter's box, tugs at his gloves, taps his feet, touches the bat to home plate, the casual observer is thinking: "get on with it already you superstitious nut." (This video of Nomar Garciaparra is a textbook example.)

But for the players, these routines "bring order into a world in which players have little control," writes anthropologist George Gmelch in a paper titled Baseball Magic. "And sometimes practical elements in routines produce tangible benefits, such as helping the player concentrate." Gmelch notes that "A ballplayer may ritualize any activity--eating, dressing, driving to the ballpark--that he considers important or somehow linked to good performance."

programming habits

Photo by visualpanic

5 Good Programming Habits
  • "The best trick I have is to type the sequences/use cases like a story before I write any code. The outline I create is read over and over, tweaking as I go." -- Dan Douglas
  • "Solve small, individual problems (The rule of 'encapsulation'). If I try to make one part of my code do too much, then I've invited trouble." -- Sean Devlin
  • "I like to write a routine first as pseudocode in comments, then translate the comments into source code. I find that this is a much faster method for me than writing the source code first. Any mistakes I make in the pseudocode are more easily fixed there than if I wrote the code first. As a bonus, I have accurate and useful comments when the routine is completed." -- Jeffrey Henning
  • "Make improvements often -- even if they are small -- so you are always making some progress." -- James Stauffer
  • "I make sure that I get a reasonable amount of sleep and that I come back to each piece of code/design/etc. after 'sleeping on it' so that I see/think about it from different angles and states of mind. This helps with everything." -- John Mitchell

And in this, the rituals performed by baseball players aren't all that different from the habits of productive programmers.

Issac Kelly, Lead Developer at Servee.com, explains it this way: "To me, programming is really the 'last mile' to getting something done. When I do the planning and specifications, I go on lots of walks, take lots of time with my wife, and really do as little work in front of the computer as possible.  The more I plan (in my head, on paper, on a whiteboard) the less I program; and all of my rituals are to that end." Before sitting down to a coding session, he gets a big glass of water, takes everything off of his desk, and closes out all programs and e-mail, keeping open only his code editor. The office door is shut, and some sort of music is playing ("typically an instrumental only, like my 'Explosions in the Sky' pandora station," says Kelly).

[ For more odd tech habits, read IT superstitions: Astrology, sacrifice, and demons and Would a server by any other name be as functional? ]

Still not convinced of the baseball/programming analogy? Consider this:

One cup at a time
Dennis Martinez, the first Nicaraguan baseball player to play in Major League Baseball "would drink a small cup of water after each inning and then place it under the bench upside down, in a line. His teammates could always tell what inning it was by counting the cups."1

Sean Devlin, a programmer at Servoy, employs a similar time-tracking method. "I keep a scratch pad open on my computer," says Devlin, "and I add a line about every fifteen minutes with what I did, no matter how minuscule. This has a couple of effects. First, if I don't have anything to write, then I know I wasn't concentrating. Second: When programming is tedious, and I feel like I'm not being productive and I look at the twenty-five things I did in the last half hour and it gives me motivation to stay focused."

Hollywood, take me away
Dan Douglass, Technical Director at InSite Interactive, finds that "reading outlandish books or watching over the top movies/tv shows seems to help trick [his] mind into critical thinking." That's not so different, really, from former Yankee pitcher Denny Neagle's habit of going to see a movie on days he was scheduled to start.1

The way to a man's heart
"Wade Boggs ate chicken before every game during his career" and "infielder Julio Gotay always played with a cheese sandwich in his back pocket."1 So should we be surprised when Aaron Overton says he does his best work at Denny's? "I take my laptop and go to diners and restaurants (free wifi is key!)," says Overton. "Background noise of people talking, dishes clanking, and all that then just blend into the background and the focus arrives."

ITworld LIVE

DevelopmentWhite Papers & Webcasts

Webcast On Demand

How to Distribute Apps to Your Mobile Workforce

When considering enterprise app deployment, you may find some unexpected challenges and a number of options that range from simple distribution to running your own enterprise market. How can you determine the best approach for your organization? MOTODEV for Enterprise can help you understand and evaluate current enterprise deployment technologies and learn best practices that support your choice.

Sponsor: Motorola Mobility

Webcast On Demand

Authentication, Certificates and VPNs

MOTODEV for Enterprise can help get you up to speed quickly on key topics such as how to enable secure access to a company intranet from outside the firewall. This webinar provides a clear explanation of terms and technologies and what they can do for your enterprise app development.

Sponsor: Motorola Mobility

Webcast On Demand

Improving Enterprise App Quality with MOTODEV App Validator

MOTODEV for Enterprise supports quality app development for businesses, government, and institutions with technical resources and tools such as the MOTODEV App Validator, a free static analysis testing tool.

Sponsor: Motorola Mobility

White Paper

HR Analytics: Driving Return on Human Capital Investments

In today's economy, it's critical for organizations to make employee retention and development a major business focus, to ensure that valuable employees are not lost as the economy improves. With advanced BI solutions, organizations can be supported by workforce analytics to drive return on human capital investment and to see the value the workforce delivers to organizational performance. This white paper demonstrates how the increased power of having metrics and analytic insight can align core HR business processes with organizational goals and strategies and help ensure organizations make the right business decisions today for tomorrow.

White Paper

Positioning the CIO as a Powerful Business Partner with IT Portfolio Governance

In this whitepaper, learn how you can become a visionary portfolio manager and transform IT into a streamlined revenue and profit center.

See more White Papers | Webcasts

Ask a question

Ask a Question