Slashdot Mirror


Programming Warm Ups?

ResHippie asks: "No athlete or musician would think about just diving in to the day's activity without doing some series of warm ups first. Aside from starting most computing sessions with checking email and the like, I pretty much try to dive right in to the task at hand. It usually takes me a while to get going, though. Does anyone have any routines they go through before coding (or any other work-like activity) that helps?"

11 of 84 comments (clear)

  1. coffee by Hubert_Shrump · · Score: 4, Informative

    coffee, a little slashdot... poking at any outstanding errors, reading through error logs from the program in question... rereading the source, adding better comments to sections that you've forgotten /again/ how they work... write a little documentation, update the changelogs...

    THEN the new code.

    --
    Keep your packets off my GNU/Girlfriend!
    1. Re:coffee by compwizrd · · Score: 4, Funny

      and by that time, it's time to go home!

  2. The usual by adamy · · Score: 4, Insightful

    Drink Coffee
    Read Email
    Read Slashdot

    Actually, the best way I've found to get into the zone is to leave a compiltation error from the previous day. It is the mental equivalent of a stack pointer from which you can pop all of your registers, reinitialize the idle process, and start cranking.

    example //Working here, trying to get the right objects from iterator
    BadObject b = iterator.next();

    Yes, I work in Java. Compiler will shout about bad object types, and I'm off.

    --
    Open Source Identity Management: FreeIPA.org
  3. Warm-Ups? by chemstar · · Score: 5, Funny



    I don't know, five years at a University?

  4. Gradual warm ups by GuyMannDude · · Score: 5, Funny

    I usually start the day's coding session with a slow progression of vocal cord exercises that simulate what will be done later in the day.

    Start with simple cursing. "Dammit. I can't believe I left that variable uninitialized." Then gradually build your way up to more intense grumbling, being careful not to overstrain your vocal cords. "Holy crap that goddamn idiot Jack still didn't fix that bug? That was a week ago! What does that fat sack of shit do all day long?" From loud complaining you work your way into loud yelling and screaming. "Fuck you, MSVC++! Don't tell me 'internal compiler error'! What the fuck kind of shit is this! You goddamn cocksucker! Fuck you Gates! Yeah, fuck you!" Now that your blood temperature has raised a few degrees, you can begin doing whole-body exercises. Jump up and down and scream "Fuck! Fuck! Fuck! There's no error there you shithead compiler! That's perfectly legal C++! Just compile it you fuck!" Then pick up your monitor and pretend to throw it against the wall. Start gradually at first, eventually working into really whipping your torso around. This will make sure you down strain any ligaments in your lower back when you finally do snap and start trashing your computer.

    Remember people, safety first!

    GMD

  5. Space out by fredrikj · · Score: 5, Funny

    Obligatory Office Space quote:

    Bob Slydell: If you would, would you walk us through a typical day, for you?

    Peter Gibbons: Yeah.

    Bob Slydell: Great.

    Peter Gibbons: Well, I generally come in at least fifteen minutes late, ah, I use the side door--that way Lumbergh can't see me, heh--after that I sorta space out for an hour.

    Bob Porter: Da-uh? Space out?

    Peter Gibbons: Yeah, I just stare at my desk, but it looks like I'm working. I do that for probably another hour after lunch too, I'd say in a given week I probably only do about fifteen minutes of real, actual, work.

  6. Warm ups for the entire body by GuyMannDude · · Score: 4, Funny

    Make sure to do exercises for each part of your body:

    • Fingers: They do a lot of work during the day so you need to make sure they can handle the stress. Start typing gibberish at a gradually faster pace until you drive the guys in the nearby cubicles nuts with your key-clacking.
    • Eyes: You will be staring at code for long hours. Start by visiting your favorite pornography site. Stare at a hot picture, unblinking, for several minutes. Repeat with a new picture over and over again until your eyes begin to get tired.
    • Mouth: Your jaws will get fatigued during an entire day of sitting and snacking. Warm up by chewing on a sock for 30 seconds. Rest. Then try for 60 seconds. Remember to use a brand new sock for each day -- resist the temptation to use the same chew-sock for each morning's warmups.
    • Lungs: Breathing is very important. Sigh louder and louder over and over again until your coworkers tell you to knock that shit off and get to work.
    • Butt: It will get tired of supporting your ponderous bulk in your chair for hours on end. Stand up and plop yourself down in your chair repeatedly. Stop when you get bored or if your chair breaks, whichever comes first.

    Hope that helps,
    GMD

  7. Python by Apreche · · Score: 4, Interesting

    I usually open up the interactive python session and try a couple things out. It's not really a warm up, I'm trying to learn python. I guess it could be though. Try a few lines of code out, then get down to business.

    --
    The GeekNights podcast is going strong. Listen!
  8. Advice for writers by DrCode · · Score: 4, Informative

    This is similar to some advice I heard for writers:

    When you're being really productive towards the end of the day, stop before you're finished. Then you'll have something easy to start with at the beginning of the next day.

  9. Exercise by LadyLucky · · Score: 4, Insightful
    OK, so maybe I'm lucky and I have a work subsidized gym membership at the gym which is on the otherside of the carpark, but I find there's nothing quite like a bit of exercise (swimming is my cardio of choice) to get the blood pumping, gives you some alone time in the zone to toss around those ideas for sexy code.

    That, or coffee.

    --
    dominionrd.blogspot.com - Restaurants on
  10. little annoyances first by pz · · Score: 4, Informative

    To start a serious coding stretch, I take care of outstanding things that will be a distraction. Like, as many others have suggested, reading email, Slashdot, checking whatever web pages your mind might drift to, chatting with co-workers and boss, using the bathroom, eating lunch, etc. Then, make a cup of coffee, turn off telephone, select appropriate music, put on headphones, and start cranking.

    If you can't leave your development tools in a specific state between coding sessions (ie, if you are required to or prefer to shut down compilers, editors, IDEs, and the like when not in use), then, as others have suggested, leave a syntactical error at a key location which will clue you in to where you were mentally (this is not so much warm up as a token to make the process faster next time around). Even if you don't shut your tools down, it's nice to have a quick description of what you were working on before to continue from. I often will write down a couple of key phrases on a piece of paper or yellow sticky (eg, "check interaction between reduncancy check and precomputation" or "examine compute_latency() output to be sure each event is valid") left on my keyboard.

    Now, to really answer the question, I don't think anyone does any mental exercises to warm up. I also don't think they're necessary -- most of the posted answers, including mine, deal with preparing your environment for work, not yourself. The most common exception to this is ingesting caffeine -- and this is well-known to initially have a sharpening effect on cognitive ability. The most difficult part of doing hard coding is recovering the mental state, and while not exactly preparation for coding, it's the biggest step when resuming an earlier coding session, and many other posters have given good tips.

    --

    Put my fist through my alarm clock with its ding-dong death inside my ear. - The Blackjacks.