Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Best Performance

by pokemonk (Scribe)
on Nov 29, 2001 at 07:58 UTC ( [id://128278] : perlmeditation . print w/replies, xml ) Need Help??

Hello Monks.

I joined the Bloomington High School South Swimming Team about a month ago. I didn't know anything, I couldn't ever freestyle, i sucked. I've worked my way up the ladder, I've improved a lot, I still suck tho, but not as bad. The coach said i'm a sprinter, she said that my event is the 50 Free. I trained hard on swimming 50 yard as fast as i could. Today, the coach gave us the lineups for tomorows first meet of the season. I'm in the 100 Free race!! I can't swimm 100 yards efficiently. Right now, i'm getting ready for tomorrow, i'm really really nervous. So i decided to code for a little while, and i noticed i was coding like a pro(like you guys). I was writing really fast, efficient programs, no syntax errors, zero bugs, i was exited, so i decided to write this node. So i'd like to know some stuff:

Does the way you feel affect the way you work?
If yes, what helps you and what doesnt?
Do you guys do things that make you write better code?
Day, night, or nonstop?

Just a lil question. Thanks.


Replies are listed 'Best First'.
Re: Best Performance
by jepri (Parson) on Nov 29, 2001 at 09:49 UTC
    Being dumped does it for me. Right afterwards I tend to slam out code for about 20 hrs, then sleep. Repeat etc. Part of that is state of mind, part of that is lack of distractions.

    Even in less stressful situations coding is my meditation zone. When I sit down and go into that frame of mind, I think less (or not at all) about my surroundings and worries about other things. It's necessary to be able to hold enough of the program in my mind. Enough for what? Enough to code it.

    The downside of this is the severe grumpiness I get when somebody jolts me from that state prematurely.

    I didn't believe in evil until I dated it.

Re: Best Performance
by greywolf (Priest) on Nov 29, 2001 at 10:30 UTC
    Mood definately has an impact on my coding.

    I tend to write my best stuff when I am in a good mood. I get into a goofy kind of mode. I mumble to myself, make smart-ass remarks for no apparant reason (feel pity for my co-workers). In this mindset I am more open to creative and weird ideas. I can do lots of brain storming and I look at problems from a different perspective. I actually want to find the slickest way to solve the problem.

    When I am in a bad mood I find it hard to concentrate on a problem. I get part way through and I forget where I was heading. At these times I am usually more interested in just getting it over with than coming up with something creative.

    To keep myself in a good mood I will listen to a little music or talk to someone about things that have absolutely nothing to with programming. I try to do small projects rather than large ones. Scratching many items off my 'to do' can feel good and it's easier to fix up small projects when I'm in a better mood.

    Being able to focus on other things for short periods of time is the key to maintaining my good mood.

    mr greywolf
      I must completely agree with mr.greywolf on this one. I think music in the workplace completely eases the mind and allows me to focus on what I am working with at the time. I also believe I am more productive when I am talking nonsense with my co-workers.
Re: Best Performance
by dorko (Prior) on Nov 29, 2001 at 10:13 UTC
    Well, I'm not sure I've ever written fast / efficient / no syntax errors / zero bugs code; except for maybe "Hello World!" programs - but then again, I distinctly remember fubaring one of those too (in Motorola 68k assembly...), so I can't really address your primary question. But I have done a fair amount of swimming and some of the best advise from my coaches was that anything under 500 yards is a sprint.

    So don't bother pacing yourself for 100 yds. Go all out.

    Best of luck in your race.



Re: Best Performance
by Beatnik (Parson) on Nov 29, 2001 at 17:19 UTC
    For some reason I have peak moments, think it's a biorythm thing, where I seem to do vast amounts of coding & documenting. At that specific moment, no apparent bugs & syntax erros appear. When I'm checking my code over again later, some logical parts are missing, smaller bugs surface, etc. Things that didn't show up when I was in a code trip. When I'm on a go, I can go on for hours, if necesarry grab the notebook with me to the couch or bed and type on there. Coffee (& caffeinne based beverages) tend to keep me awake -surprise surprise-, time at that point doesn't matter. Maybe it's just because perl is SOO addictive?? :)

    ... Quidquid perl dictum sit, altum viditur.
      Monday mornings, hangovers and collegues playing heavy metal adversely affect my performance :}
Re: Best Performance
by dragonchild (Archbishop) on Nov 29, 2001 at 18:52 UTC
    As a former swimmer and coder, I understand exactly what you're talking about. Whenever I was in excellent shape, code would just flow from my fingers. I think it had to do with the fact that my body and mind were in sync.

    Recently, I won the Ohio State Championships for Magic, the Gathering. I'd been close before, but the change was that I decided there was no option but to win. I wanted it so bad I could taste it, and I didn't allow myself any distractions. Before, being in the Top 8 would rattle me, but I didn't allow for that to happen this time.

    What does that have to do with coding? Well, if you're constantly distracted or thinking about what is going on around you, then you won't be able to concentrate on what you're doing. That applies to both coding and swimming.

    What I used to do before meets was to try and enter a slight meditative overlay, almost a mild auto-hypnosis. That would help me retain my calm and focus. Then, right before I entered the pool, I would shift out of that and start getting myself pumped up. This would allow me to go from a rested state to an active state very quickly and efficiently.

    Don't worry about not doing well your first few meets. I remember a football player joining the team in college to keep fit during the off-season. He sucked. But, he kept at it and became a valued member of the team by the end of the year. Swimming is arguably the hardest sport to excel in at the lower levels, because it's the most alien sport for humans. Keep at it, and welcome to the best sport in the world. :-)

    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Re: Best Performance
by snapdragon (Monk) on Nov 29, 2001 at 19:49 UTC
    I'm not advocating alcohol abuse here, but I've always found that a raging hangover helps. I think it's a partly to do with feeling so awful (gurgling stomach, throbbing head, you know the feeling) and I need some thing (anything!) to take my mind off things.

    So coding is perfect. I get to slam on a pair of headphones, put on some relaxing music and start working. Hours can pass. And here is the really good bit: when I come out of the 'coding zone' not only have I written some good stuff but my hangover has receded considerable.

    Something else has just occoured to me. In a normal day I get dozens of interuptions which really break my train of thought. I like to think of myself as a pretty approachable guy so I can't complain too much about this really. But I know when I'm hungover I look different - generally I'm unshaven and have a big ole scowl on my face. So people tend to stay away which helps me concentrate, thus I get more done.

      What about going unshaven and scowling, but without the hangover? Who will know but me and thee?

      "That that is, is... for what is that but that? and is but is?" Shakespeare, Twelfth Night, Act IV, Scene 2

      "Yet THAT which is not neither is nor is not That which is!" Frater Perdurabo (pseud. Aleister Crowley), Liber CCCXXXIII, The Book of Lies
Re: Best Performance
by hsmyers (Canon) on Nov 30, 2001 at 00:50 UTC

    Lets see…in order you asked:

    • Does the way you feel affect the way you work?
    • If yes, what helps you and what doesn't?
    • Do you guys do things that make you write better code?
    • Day, night, or nonstop?


    The first one is easy. Think of all of the words for 'Yes' you can, add them up and there you have it. As an aside, the shape (physical, mental) you are in effects the way you work as well. Both of these shape the quality of your work—the better your shape, the better you feel, the better the result.


    Well, lets just say that endorphins are your friend! In my case, I usually spend about two hours working out at Gold's Gym before I start work for my client. Actually, that is not quite true since I often use the time between sets to solve problems and sort out solutions.


    Oddly enough, one of the best ways to write better code is to write code—lots of it!. The classic answer to the question of 'How do you get to Carnegie Hall?' is 'Practice, practice, practice.' Find something you either want to do or have to do in terms of programming and write a solution. Repeat, read PerlMonks in the morning.




Re: Best Performance
by rje (Deacon) on Nov 29, 2001 at 23:21 UTC
    Oh yes. If I feel depressed I don't care about coding.
    However, if I'm rested and have a nice, quiet, clean
    environment, I can work intensely, nonstop, for long
    stretches of time, night or day.

    Also, if the task is interesting, I'm much more likely
    to get into the groove and code like a madman.

Re: Best Performance
by ryan (Pilgrim) on Jan 11, 2002 at 06:19 UTC
    I agree that mood/environement does have an obvious effect, as does the context of your programming. My job is not solely programming, but other menial IT related tasks. When I am getting constant interruptions I canít code and just stop trying until later. When things are quiet I can go for hours.

    In this going for hours state though I only enjoy it when I am discovering new things, figuring out ways to do things I had no idea about before. If I had to write a second system slightly different to the first one I wrote, I find it very boring. Which is why I'm browsing around here at the moment :)

    I guess that is the problem solver in me coming out.