Programming magic: Rituals and habits of effective programmers

11 comments | 84I like it!
May 14, 2009, 12:21 PM —  ITworld — 

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."

Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @ITworld

I like it!
Close

On Twitter now

programming

Powered by Twitter

On Twitter now

Comments

VERY cool article

I'm listening to "Pure Phase" by Spiritualized at the moment. Album du jour.
| reply

health shmelth

two Redbulls on ice, and a can of pringles keep me in the zone
| reply

Zones? .. I do dislike this word.

When I was doing my Doctoral Thesis building a distributed & autonomous p2p self-healing file system I used to do one of two things depending upon the time. I lived in Perth Western Australia at the time, which is right on the peninsula in Maylands which faced the Darling Ranges.

In a similar fashion to your first story about the chap that delayed the coding till the last stage, I did the same.

Night:
I would go into the kitchen with the lights out and make toast on the stove using a camp-style toaster. German Rye Bread with an obscene amount of honey (Iron Bark or Blue-Gum were the favourites). I would during the eating of each slice and waiting for toasting lean on the servery and look out to the mountains, de-focus and stare mostly at the lights going on and off against the ranges. I assume it was the town of Kalamunda I was staring at, and think quietly about the problem, how to solve it, eat toast. Five or six slices and an hour or so later I'd wander in, settle down again with a glass of ice cold milk and commence solving the tiny chunk of a problem I was working on that night, dynamic hash tables or what ever.

Day:
I would take an old fashioned clutch pencil and a thermos of coffee and wander down the peninsula to one for the bench seats and spend an hour or more as necessary staring out again de-focused on the river and people walking/cycling/blading past. If I needed any storage I would use the notepad and pencil.. which was frequently because I have gold fish memory.

Coding time, was always a glass of super cold milk, and listening to nectarine demoscene music.. down very quietly. I know most of the tunes after 10+ years of listening and it would keep the easily distracted side of my brain quiet. If it was a bit too "banging" I'd tune into something quiet such as Soma-FM's "groove salad", close the door, relax with my feet up and begin after a stretch and shoulder/arm joint cracking session. Also using my SGI Octane and HP9000 c3700 or the VAX (VMS!) were emotionally very relaxing/comforting and pleasurable. Using the Mac's or Windows machines ..were just too distracting. There is too much "Going on" around your screen and the widget set.

Al.
| reply
Newsletters

Subscribe to ITWORLD TODAY and receive the latest IT news and analysis.

I would like to receive offers via email from ITworld partners.
By clicking submit you agree to the terms and conditions outlined in ITworld's privacy policy.

The IFA consumer electronics exhibition turns 50
Albert Einstein opened the 7th Great German Radio and Phonograph Show, the forerunner to today's IFA, in Berlin in 1930. The show marked the public debut of a prototype 'television receiver.' Since then, some products, like the 3DTV, were ahead of their time. Others, like the MiniDisc...well, just never got off the ground. Here's a look at IFA's storied past.

Einstein

IFA 2010
Video: Samsung launches Galaxy Tab
3D content is king at giant tech show
Video: PlayStation 3 will be ready for 3D by October
Video: Sony announces music service, hints at TV service
Google's Schmidt to speak at Berlin show
3D, tablets galore expected at consumer electronics show

Marketplace