Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
Programming IT Technology

Why Programming Rituals Work 233

Posted by ScuttleMonkey
from the still-waiting-for-the-stars-to-align-to-write-my-super-code dept.
narramissic writes "Programmers may not think that their rituals are unusual, but if you swear that your code is less buggy if you recite it aloud or you prepare for coding by listening to certain music, don't be surprised if you get a couple sideways glances. In a recent ITworld article, Issac Kelly, Lead Developer at Servee.com, explains his routine and why it works: '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.' His ritual goes like this: '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).'"
This discussion has been archived. No new comments can be posted.

Why Programming Rituals Work

Comments Filter:
  • by SerpentMage (13390) <ChristianHGross AT yahoo DOT ca> on Monday May 18, 2009 @03:43PM (#28002713)

    Before I undertake any task I do absolutely nothing. For about a day I will just idle around thinking about the problem. Kicking around one solution and another.... And I keep doing this until I am happy...

    • by microbee (682094) on Monday May 18, 2009 @03:46PM (#28002785)

      Yes, sometimes I fall asleep on the toilet when I do this.

    • by MyLongNickName (822545) on Monday May 18, 2009 @03:47PM (#28002825) Journal

      You *think* before you code? WEIRDO!

      In all seriousness, when I worked for a bank, I would go outside with a legal pad and start drawing out the logic in terms of pictures. Away from the phone. Away from the co-workers.

      At lunch one time, a coworker half jokingly said I only work 3 hours a day. My manager was there and remarked "Yeah, but he gets more done in those three hours than you do all day".

      I tried to keep from smiling... however, in all seriousness, coding is 30% of programming. too many coders consider themselves programmers.

      • by Mr2cents (323101) on Monday May 18, 2009 @04:12PM (#28003237)

        You should seriously consider giving your manager a raise.

      • by Colin Smith (2679)

        You can run just as hard and fast as you like. Doesn't do you much good if it's in the wrong direction.

         

      • by moderatorrater (1095745) on Monday May 18, 2009 @04:53PM (#28003733)

        I tried to keep from smiling... however, in all seriousness, coding is 30% of programming. too many coders consider themselves programmers.

        A lot depends on deadlines. If you have 3 things that needs to be done and committed by tomorrow, then there's going to be a tendency towards hackery. If you've got one thing that the company wants you to work on until it's finished, then you need to be more of a thinker. Programming's all about tradeoffs, and deciding which tradeoff happens isn't always the responsibility of the coder.

        Of course, most of the time management doesn't even realize that a tradeoff is being made. There's a breakdown in communication somewhere and most managers don't even realize that by pushing the deadline to be shorter they're asking for more work in the future and more bugs.

        • A lot depends on deadlines. If you have 3 things that needs to be done and committed by tomorrow, then there's going to be a tendency towards hackery. If you've got one thing that the company wants you to work on until it's finished, then you need to be more of a thinker.

          I agree to a certain extent, if I'm given a deadline by which something has to be done by (like it's being shipped off somewhere or someone important has to see it) then I'm more able to finish the task in a timely manner (even if I rush things in the last 'minute') than if I were just told it has to be done but without any time parameters.

          As for rituals, I find if I've got a programming/construction problem within a project I find getting away from where the thing is being programmed and/or built frees m

        • by luder (923306) * <[ten.sarbl] [ta] [todhsals]> on Monday May 18, 2009 @07:36PM (#28005429)

          If you have 3 things that needs to be done and committed by tomorrow, then there's going to be a tendency towards hackery. If you've got one thing that the company wants you to work on until it's finished, then you need to be more of a thinker.

          I bet Duke Nukem Forever team members are all philosophers, by now...

        • by umghhh (965931)
          I think this is false dichotomy - some jobs are relatively standard (at least for the particular designer) and this means you can just sit and code. Some jobs are impossible to be done this way - you have to draw sketches and think about ways to do things. Interestingly you can also do that by coding only you cannot expect that these first sketches will be right but rather prototypes or experiments if you will.

          Whether management has understanding for such practices is another thing - in corporation I once

      • I have a set of colored find point pens I use to draw out E.R. diagrams and then pseudocode on pads long before I sit at a keyboard.

      • by 16K Ram Pack (690082) <tim...almond@@@gmail...com> on Monday May 18, 2009 @05:20PM (#28004047) Homepage

        It's one reason I prefer to charge clients for the job than the hour. Because like the author, by the time I sit down to code, I've worked out precisely what I want to do. When I'm writing code in the evening, I might be reading slashdot, twitter and all that, but I'm quite frequently also buzzing code around in my head. I can almost feel the things forming, juggling around 2 different approaches and letting the brain work out which way it likes better.

        It means that when I sit down, the code is more like typing.

    • Re: (Score:3, Insightful)

      by LucidBeast (601749)
      I do the same with a twist... and then I drink my beer and code.
    • by jeko (179919) on Monday May 18, 2009 @04:13PM (#28003247)

      Here's a couple of long out-of-fashion words; contemplation and reflection.

      There is no "process" -- not change requests, not planning documents, not maintenance windows, not design documents, and for damn sure no flavor-of-the-month buzzword -- that can replace someone with a brain thinking the problem through.

      The problem with this is that it exposes the MBAs for the empty suits they are. Our "business team" -- salesmen with glorified titles -- sit through every meeting bloviating while the engineers get it done. The PMP certs are the worst about it. Me and a customer engineer will put our heads together about something, and decide on a course of action. The PMPs will jump all over it and send out emails about "deliverable actions items."

      One of the other engineers will mention something, and we'll realize we should take a different approach. While we're getting real work done, the PMPs will barge in demanding to know if that action items has been deliverabled yet, and if not we need to reprioritize our skill sets.

      I used to try to explain it to them. We were going to do that, but then we found out this, so were doing something different. I kept getting haughty responses about how they didn't need to know the little tech stuff, they were just managing the project.

      One of them went on at huge length about how you didn't have to be a doctor to be a chief of staff at a hospital.

      At that point I just began to feel sorry for him. Can you imagine living your life hoping and praying that no one will ever realize that you don't have the first clue about what you're talking about?

  • AAAAAnd (Score:5, Funny)

    by Profane MuthaFucka (574406) <busheatskok@gmail.com> on Monday May 18, 2009 @03:45PM (#28002763) Homepage Journal

    There's Slashdot. Even when I do everything else, Slashdot is the final work-preventer.

  • by Anonymous Coward on Monday May 18, 2009 @03:45PM (#28002771)

          1. Make a cup of coffee: Community New Orleans blend, one sugar, hazelnut creamer.
          2. Read reddit.
          3. Check social status sites: facebook, twitter, etc.
          4. Read CNN.
          5. Read email.
          6. Catch up with coworkers.
          7. Juggle a bit.
          8. Put on headphones. Go to last.fm and hunt for a station that fits my current mood.
          9. Check reddit again.
        10. Go to lunch.
        11. Read email.
        12. Check reddit again.
        13. Update to-do list.
        14. Check icanhazcheezburger, etc.
        15. Pick different last.fm station.

  • If you distill any of the accepted processes down then you plan first, even in agile processes. To summarize the summary: If you plan first and clear your workspace of distractions you do better work...
  • by russotto (537200) on Monday May 18, 2009 @03:48PM (#28002845) Journal

    ...when I make sure to release it when most of the testing group is on vacation. Vastly cuts down on the initial bug list, let me tell you.

    • Re: (Score:2, Insightful)

      I think the biggest problem with programming is the number of programmers involved and the size of the project. It's really the testing group/QA departments job to catch the bugs. I listen to music while i work, granted I install network hardware, but it makes the day go by faster and seems to be more productive than listening to the phone ring or staring at the wall for hours on end. I think that programmers are given too much crap. They may make coding errors, but they are human. Another set of eyes on a
  • by Mr2cents (323101) on Monday May 18, 2009 @03:48PM (#28002847)

    The key to good software is contemplation. You can feel the social pressure at the workplace to be typing all the time, but it's wrong to give in. If they want someone who's banging on his keyboard all the time, let them hire a typist.

    • Re: (Score:2, Funny)

      by m50d (797211)
      If they want someone who's banging on his keyboard all the time, let them hire a typist.

      Or a group of exhibitionists.

    • by Bamafan77 (565893)
      "The key to good software is contemplation. You can feel the social pressure at the workplace to be typing all the time, but it's wrong to give in." Quote from a PM: You're not paid to think! (seriously)
      • by Mr2cents (323101)

        Quote from a PM: You're not paid to think! (seriously)

        I would not let that opportunity pass to let him know *exactly* what I *think*. And I would start updating my resume immediately. And use that quote in job interviews to let my future employer know where I stand.

        You might be more accepting, but personally, that's one of the few things that can make me angry. I didn't spend all those years in college to just throw away my brain the moment I get out.

  • by Fantom42 (174630) on Monday May 18, 2009 @03:49PM (#28002863)

    Sure, some of what the article talks about is a ritual, but the planning process isn't a ritual at all. Its a process. One that usually works pretty well, I must add. The less time you spend coding, the better your product is usually going to be. That said, knowing when to put down the whiteboard is sometimes important too.

    • Re: (Score:3, Funny)

      by Chabo (880571)

      Duke Nukem Forever had this problem. They spent so much time saying "THIS GAME IS GOING TO BE SO AWESOME" that they never wrote any code!

    • by Mr2cents (323101) on Monday May 18, 2009 @04:07PM (#28003151)

      There's even a simple proof of that: all bugs come from coding. Therefore, the less time you spend coding, the less bugs you'll produce :-).

    • by Yvanhoe (564877)
      In the world of 2009, planning for anything instead of waving frantically in all directions while shouting that all the bugs are another's person fault passes for ritualistic voodoo thing.

      I don't care that you have a fetish for planning kid, but do this at home, a workplace has some standards to hold.

      Oh, another person asked me today how open source efforts could work by only using people's free time...
  • by Black Art (3335) on Monday May 18, 2009 @03:53PM (#28002917)

    I can fully understand using such rituals. It helps you get in the right head space for writing code. It gets you focused on the task and flush out all the other crap trying to get your attention.

    I have found that if I am not in the right frame of mind before starting, the code takes much longer or is just plain wrong. If I am in the right head space, the task is quick and done before you know it.

    • I agree 100%.

      I have found that if I am not in the right frame of mind before starting, the code takes much longer or is just plain wrong. If I am in the right head space, the task is quick and done before you know it.

      It's not just coding, either -- anything requiring concentration and analytical thought benefits from being in the right frame of mind.

      One of the tricks I learned from a former boss was to identify what gets me "in the mood", and then practice at streamlining the process until I could turn it

  • by blahplusplus (757119) on Monday May 18, 2009 @03:55PM (#28002973)

    I think the problem with planning everything too much is that you can't hold all the details in your mind at once, and sometimes your planned approach is not as good as one you come up with later given some time to stew on it (doing nothing).

    I think programming is a very iterative process because it is symbolic and non-visual (i.e. not like building something with structures that are easily and intuitively able to grasp their structural and interconnected relationsihps)

    • by DragonWriter (970822) on Monday May 18, 2009 @04:18PM (#28003305)

      I think the problem with planning everything too much is that you can't hold all the details in your mind at once

      Yeah, if only there was some way of tracking information without keeping at all in your head at once.

    • by Blakey Rat (99501)

      I think the problem with planning everything too much is that you can't hold all the details in your mind at once,

      For a mere price of $1100 I can sell you this new invention I've come up with. It's called a "legal pad." Combined with a high-tech "ballpoint pen" it allows you to keep track of thousands of details-- without holding them all in your head!

      They're going fast, call today.

  • Sweet, to see one of my fav bands mentioned on Slashdot of all places :-)

    • by Hatta (162192)

      You know, I enjoy the instrumental post rock thing. But I'm hard pressed to see what would make one band your favorite over another. EITS, Mogwai, Mono, Tortoise, I enjoy listening to them, but damned if I can tell the difference between them.

      • They were the first I heard, and the only one I've been able to see live so far (where they were fantastic).

  • by eggfoolr (999317) on Monday May 18, 2009 @04:01PM (#28003069)

    Crikey! That's just sensible work organisation. I guess if you find something that works and always do it that way you might call it a ritual. My ritual is to get in the car and go to work every morning... that way I can do, well you know... WORK!

  • I usually just stare at the code until it starts staring back; that's usually about when I realize that it's 6AM and I need to sleep.

  • I'm curious if other programmers like to code at night or any other particular times.

    • by gangien (151940)

      my best code seems to come at about 12-2am. much past 4 and my code sucks unless i'm really in the zone.

      • by Eudial (590661)

        This is my zone too. I can code earlier, but anything done before 9 PM will lack inspiration.

    • by EkriirkE (1075937)
      1-3am when I'm already tired in bed. I seem to be most productive in this state... But I can't really do that for work when they expect me to be in the office at 8:30am where, at that time, I am just a zombie F5'ing Slashdot waiting for a reply-worth story to appear for a few hours until when I mentally wake up.
    • I have to "ditto" this. I _hate_ having to come in in the morning - it's bloody pointless since I'm just going through the motions until later in the day, anyway. But, Big Co. would rather have my butt in a seat at a specific time rather than have me productive. Whatever - I get paid the same, either way.

    • I'm definitely a night coder. The phone's not ringing, there's no temptation to go outside and play in the sun. My wife's asleep, and that problem I've been thinking about all day is just shouting an answer at me. If I start coding at midnight, I can start checking off milestones at 4am, and then they start dropping off at 4am.

      I can't wait until I can start doing that again, but with the recent birth of my son, I sleep any time I possibly can. If I plan to code from midnight to 4am, he'll definitely
    • by toddestan (632714)

      Right after I come in, about 7-9:30 am (I like to come in early). Mainly because I've had some time to mull over the problem, and because there are less people to bother me that early. Staying late is pointless - by that time I'm mentally exhausted, and my level of care starts to go down to the point where I'm just throwing mud at the problem aiming for the quick fix. I'd be a wreck by night time. I'm much better off if I stop, rest, think about what I'm trying to do, then implement it right away tomorr

  • Close door (Score:5, Insightful)

    by ichthus (72442) on Monday May 18, 2009 @04:18PM (#28003307) Homepage
    I write firmware for a living, and I WISH I had a door to close. Nothing is more annoying or infuriating on my job than when coworkers are loudly shooting the bull while I'm trying to read a datasheet and figure out register settings.

    "S.. TF.. U!"

    I can code with some noise in the room, but I need QUIET when I'm reading a tech spec. I wish I had the ability to mask external stimuli.
    • Re: (Score:3, Informative)

      Wear Gun Muffs...

    • by ajlitt (19055)

      Get a matte screen monitor and some earplugs or IEMs with good isolation. You know you're doing it right when coworkers have to tap you on the shoulder to get your attention.

      • by ichthus (72442)
        Good suggestions, and funny you should mention earphones. As a sort-of geeky solution, I've actually tried looping a WAV file of pink noise [wikipedia.org] (easier on the ears than white noise). It's not great for my hearing, but does wonders for my sanity/concentration.
        • Re: (Score:3, Informative)

          by ajlitt (19055)

          I bought a pair of Etymotic ER6i IEM earphones four years ago and I still consider it one of the best purchases I've ever made. I got them originally so I could listen to my own music at the gym without having the stuff they play there bleed in. They worked so well that I now use them in my cube or occasionally in noisy environments like our lab.

    • Amen to that. Developing even the simplest things (and trying to keep each piece in your head as you get it down on paper / in code) can be mind bogglingly frustrating when there's lots of noise. Couple it with working informally in the vicinity of a load of computer illiterate morons, and you have my 100% guaranteed recipe for insanity :)

    • by blhack (921171)

      Get yourself a set of these [amazon.com]

      They're headphones designed for drummers and will cancel out almost ALL noise in your office except for some music if you want it.
      You might look like a dork, but you will have your sanity.

  • WTF (Score:5, Funny)

    by Godji (957148) on Monday May 18, 2009 @04:30PM (#28003449) Homepage
    he gets a big glass of water, takes everything off

    I stopped reading right there.
    • Re: (Score:2, Funny)

      by Anonymous Coward

      I put on my robe and wizard hat...

  • by Anonymous Coward

    My ritual consists of watching this [youtube.com] and then killing a goat

  • I spent a good year of college programming only listening to X-Cops: You Have The Right To Remain Silent [amazon.com] and Bloody Kisses. [amazon.com]

    Maybe it just replaced distracting noises with familiarity instead?
  • When I find a bug (Score:2, Interesting)

    by lhoguin (1422973)

    My only ritual is that if I find a bug or a problem that I can't resolve in less than 5 minutes I take a few hours off. After a while I get back to it and am usually able to resolve it without much trouble.

    • When I find a bug, I publicly blame it on someone else. This guarantees that, within five minutes, I will find the bit of my code which caused it in the first place.
  • Now, let's have no more denigrating the practice of waving a dead chicken over the computer.

  • I am a messy individual at times. I can leave junk strewn around and know where everything is exactly. However, this seems to incur some computational or cognitive load ... I think it is probably a copout to avoid thinking about other things. Anyway, if I make my environment clear and uncluttered, screen too, then I am more relaxed and can think more clearly.

    I should also say something here about Network Admins and the need to sacrifice chickens to the God of Problem Solving but it is probably obvious to al

  • That's true for some coding, peace and getting in to the zone with the meditation helps a lot.
    But some coding, usually when working with other people code or debugging just required brute force beating your head against the monitor till bloody. I just can't to the Jolt, or now days Red Bull thing anymore.
    I an getting too old for that sh*t.

    That music isn't half bad,http://www.myspace.com/explosionsinthesky

    I usually do old school electrofunk or techno, MIA, Philip Glass, Vangelis, Aphex Twins.

  • by hey! (33014) on Monday May 18, 2009 @07:03PM (#28005137) Homepage Journal

    It's magic.

  • I'm developing a course for aspiring computer programmers. I've been at it on and off for the past year. The reading list is done, the course outline and coverage isn't entirely done but is shaping up. This sounds like material that should be covered. Does anyone have a good writeup or recommended book for inclusion in the course? The Programmers Stone guys sort of cover this material.

    You can see the course here:

    From Beginner to Master A Computer Programmer's Reading Course So, you want to be a com [reactor-core.org]

  • by ThousandStars (556222) on Monday May 18, 2009 @07:13PM (#28005227) Homepage
    What he's really describing is how he gets away from distractions and puts himself in an environment conducive to working. Regarding the former, I wrote about and linked to many of the essays and some of the research dealing with distraction problems in this post [jseliger.com] and talk about some of my environmental cues, including equipment, in this one [jseliger.com].

    When you can prevent useless distractions, then you're really ready to go. Of course, I'm posting this on /., which shows me to be something of a hypocrite, but I think the point still a useful one.

  • Take a shower (Score:4, Interesting)

    by notthepainter (759494) <oblique@nOSPam.alum.mit.edu> on Monday May 18, 2009 @07:41PM (#28005475) Homepage

    I'm serious. I find that I solve many of my hardest problems in the shower. Now that I telecommute 100% of the time I'll often just take one, say in the middle of the afternoon, to jump start the solution!

    Obviously the shower has nothing to do with the situation, it is the "stepping back" that is important, so find something that works for you, and do it.

  • You're asking something (a computer) to do something (a task) with no feedback unless you ask it (logging), and no consideration of external constraints (memory and latency). And you're supplying it with commands such that the computer is not operating in your context: that it has no knowledge of your context (domain needs) since every computer operates the same way (i.e. logically).

    You need to get into a state of mind to satisfy all those needs to communicate (program) to a computer, hence a ritual makes

  • I saw a HARO request on this 11 days ago asking for, "Query:I'm looking for programmers who are willing to share any rituals or habits they have that help them code better -- whether by improving concentration or warding off buggy code or what have you. Email responses please."

    That being said, not to dismiss the article, they were intentionally looking online for people that fit this category. Of course anything can be found online, and this leads toward a self-selecting population.

    Just saying..
  • by Eudial (590661) on Tuesday May 19, 2009 @02:48AM (#28008461)

    I prefer to work with intuitive models. My "ritual" is as follows:

    1. Ponder the problem. Not too hard. Just get a feel for how to solve it.
    2. Prototype a solution in some readable language (python?).
    3a. If the prototype is horribly broken, scrap it and go back to step 2.
    3b. Otherwise, create final solution from lessons learned from prototyping.

    A lot of people draw diagrams and flow charts and stuff. But that is stupid and too abstracted from the computer to be all that useful. By making a prototype, you're effectively making an interactive diagram/flowchart. It takes about the same time, and any problems will be immediately obvious.

: is not an identifier

Working...