Slashdot Mirror


Finding the Programming Zone?

SlashDotDashDot asks: "As a developer for 20+ years, I've developed a fairly fine tuned way to find 'The Zone' for optimal programming - a combination of furniture arrangement (PC and chair), lighting and music. I also have a pretty good sense of what time of day is best for working on a particular set of problems. But this is what works for me. My company is growing and I'm needing to mediate working conditions between my clients and consultants. This has me wondering what others have found important for finding 'The Zone' in their programming lives. How fast can you get there? How long does it last? What do you do that helps keep that state? What are the major interrupters?" We also touched on this issue in a similar article, last year. However, many of you may have ways of attaining "the zone" that don't depend on any of the factors listed above. If you have a method that works for you, please share. It may work for others.

29 of 577 comments (clear)

  1. Excuse me? by Anonymous Coward · · Score: 1, Insightful

    I hate to tell you, but coding isn't like writing a novel. There are set ways to approach and solve a problem, and if you tell your boss that you can't work right now because it just isn't coming to you, you're out of a job. This is ridiculous.

    1. Re:Excuse me? by tenman · · Score: 3, Insightful

      We get these types in here all the time. They are fresh out of college and have no real world expr writing code. They talk of intellectual freedom, and then sit down and write the most brain dead code I have ever seen. And the consultents are even worse, cause they know in a couple of months they will be gone, and you will be holding the bag of funnel cake type code.

    2. Re:Excuse me? by John_Booty · · Score: 3, Insightful

      I'd put $1,000 down right now - there are more people writing code for a living than writing novels. Which one is easier?

      Whether you're right or wrong, your analogy isn't the least bit apt. Most programmers work on software that's customized for a particular client, or a small number of clients in a specific field. Do any novel-writers write customized novels for 3 or 4 clients? The surgeon analogy doesn't even begin to make sense. Unlike surgery, do people really need life-and-death software support? 99.9% of the time, no. In the fields where software IS a life-and-death matter (air traffic control, nuclear power plants) you can bet the software companies have engineers on call at all times much like doctors.

      Also, it's not a matter of programmers "just doing it". The question is not, "should my programmers have to work if they don't feel like it?" The question is: "how can I place my programmers in an environment where they'll be the most productive?"

      If you even think about the question asked in the story, you'll realize it's about squeezing more productivity out of programmers by creating a favorable environment for them.

      Your response is pretty sick. I'm sensing some built-up hostility there. It's true, there's a lot of whiny, overpaid, pampered programmers in the world, but that's not what this person is seeking to create.

      I believe it's possible to create a comfortable work environment for programmers and still demand maximum productivity and deadline adherence...

      --

      OtakuBooty.com: Smart, funny, sexy nerds.
    3. Re:Excuse me? by kbonin · · Score: 5, Insightful

      I'd have to make some exceptions to this position...

      Being a surgeon is like being a very talented mechanic, with an excellent memory and fine motor skills. Additionally, the rigors of internship filter out those not qualified or capable. The creative muse has little place in a field where a few fractions of a mm slip in the right place can kill someone. A surgeon can get by with zero creativity other than adapting to "normal variation" in anatomy and being able to recall what procedures to apply, and still function very, very well.

      OTOH, programming covers a wide breath of skills and abilities. Programming batch file processing scripts requires little creativity. Designing realtime attitude control systems requires grasp of many mechanical, electronic, control-theory, and scientifc fields beyond programming, and creativity to figure out how to acheive your goals. Bleeding edge 3d game engines require obscene amounts of creative design skills encompassing and correlating traditional CS, as well as physics, lighting, perceptual psychology, game theory, and much, much more.

      A sr. programmer with a design responsibility on a bleeding edge project with 'creative block' can be unable to do their job "well", even if a "professional". Sure, you can sit down and hack something out anyway, and I've seen the results of that. Unfortunately, many companies can get away with crap code, and I guess yours is one of them...

      Creativity results in elegant programming. Those who claim otherwise, likely do not write elegant code...

    4. Re:Excuse me? by psavo · · Score: 4, Insightful

      I'll tell you a thing.
      Writing code is very much like writing a novel. One day it's flowing out of you. Then on another day, it just stops. And there's no way you can easily tap it back 'ON'.
      It's not about 'formal methods'. With all your bag of formal method tricks, if you can't visualize (in some personal way) problem you're facing, then you can't apply anything to it. Nothing, nada.
      This is why CAP will never really take off. You need to really understand what is going on, and what one should do. Computer just can't do it.

      --
      fucktard is a tenderhearted description
    5. Re:Excuse me? by baka_boy · · Score: 3, Insightful

      Really, formal methods are just another way of tapping into a developer's existing knowledge of the problem, and re-stating it in a way the computer can understand. The difference between "formal" and "informal" styles of programming is mostly that formal methods offer languages, tools, and techniques for modeling a program as a mathematical system, and then analyzing that model to look for obvious problems.

      Every time you use a compiler, you're already half way to the side of formal methods -- letting the computer analyze and make assumptions about your code, in exchange for not having to write assembly routines yourself every time. Similarly, if you work in a strongly-typed language like C, C++, or Java, you're relying on a very "formal" means of error-correction: type checking.

      That doesn't change the fact that programming is a creative process, simply because the concepts being thrown around by a "formal methods" user are more functional. Personally, I think that good math is every bit as aesthetically pleasing and creative as a great novel, and have personally met a number of quite talented mathematicians who were among the most creative, individualistic people I know.

    6. Re:Excuse me? by baka_boy · · Score: 3, Insightful

      Ugh...flourescent lights...truly the bane of the working class. I find that I'm at least twice as productive when I'm working in good, natural lighting, or at least under decent full-spectrum bulbs.

      Strangely enough, I'm also usually much happier working on a full-size laptop (often actually in my lap, no less!) than a desktop machine; something about the ability to shift posture regularly, and have the computer move with me, does me more good than any number of ergonomic keyboards and back-supporting-chairs.

  2. Environment doesn't matter by SuperHighImpact · · Score: 2, Insightful

    I think your working environment is less important than the right state of mind. If I like my work, I can focus on it in the middle of an elementary school playground. I have a friend who codes from home; whenever I call him it sounds like he's working in a jungle. I ask him what the noise is and he asks me what I'm talking about. His kids are screaming and crying all over the place.

    Just like great athletes, conditions don't matter. They get in the zone and it's game over. Anyone see Steve Yzerman in the Red Wings v Canucks game last night? He's hobbling around on one leg making everyone else look like grade schoolers. Amazing

    --
    sHi
    1. Re:Environment doesn't matter by NormalVisual · · Score: 2, Insightful

      But Steve Yzerman wasn't having his game interrupted 20 times per day with phone calls from customers bitching about features that are broken because management felt it better to shove the product out the door instead of spending the up-front time to get it right, and the meetings that follow that mostly consist of management hand-wringing and complaining that the product has too many bugs. Forcing your engineers to take regular customer service calls that would not be necessary if they had been given the proper time to write the code is one sure way to kill productivity.

      --
      Please stand clear of the doors, por favor mantenganse alejado de las puertas
  3. My zone... by dasmegabyte · · Score: 4, Insightful

    ...is sometime after 5.

    Seriously. I get most of my work done after everybody leaves...nobody shooting the sh_t or asking me questions or for status reports. There's an emotion around here that open floors equate productivity, but that's just not true...I get more done the hour after the boss walks out than I do in an entire day of his polling and sneaking.

    Speaking of which, this post is cutting into that time...gonna make it short.

    --
    Hey freaks: now you're ju
  4. I used to have a zone by s4ltyd0g · · Score: 2, Insightful

    But working as a consultant you learn to get used to working in all kinds of situations. You are fortunate indeed to be able to mediate work environements for your consultants.

    Heck in one place I spent a week working in a hallway and if it wasn't for my trusty laptop I would have been twiddling my thumbs. Other than that I do my most productive work off site at home where there are less meetings and other such interuptions.

  5. The Father of Distraction: Websurfing by geoffsmith · · Score: 5, Insightful

    Nothing is more distracting than a web browser. And virtually every programmer has got one. How many people reading this comment right now should be working?

    It's even worse if you do web programming for a living. There is no hope.

  6. Depends on what you're doing by dant · · Score: 5, Insightful
    For bugfixing or pounding out an implementation of an existing design, I have pretty much the same formula as everybody else seems to (massive caffeine overdose, dark, familiar music, and ZERO interruptions--work from home if you can).

    But for design work, I find I do my best stuff in a completely different environment.

    First of all, get away from your computer. If you're doing design, you should be envisioning shapes, graphs, and so on--you should not be thinking about code. Do not look at; do not touch it. Look at a whiteboard or stare at the sky while you're doing this.

    Next, do something (other than caffeiene) to stimulate your metabolism. Play a few games of foosball, or take a shower, or have a cigar. I've done some of my best design work while standing in the shower.

    Finally, let your subconscious work on it. Keep thinking about the problem as you go about your day, but don't stress out about not making any progress. A day or two into it, you'll have an epiphany and realize that it's all very simple.

  7. Re:EXTREME PROGRAMMING! by christfokkar · · Score: 2, Insightful

    As a project manager, I introduced extreme programming and my team quadrupled their output overnight. And this is with six of us sitting in a garage with cheap office furnature.

    Right. I think what you are saying is that when you stopped whipping them in your garage and gave them some actual human contact, they were a little happier huh? Maybe you learned a lesson that treating programmers like human beings pays off in the end.

    A good office environment meets the needs of the workers. Good social contact, this is why nerf toys are popular. Some time to relax, play games, free perks like soda don't hurt either. If you make it fun, you can expect a lot. Quadrupal is nothing. Next try fixing your furniture.

  8. Retirement by N8F8 · · Score: 3, Insightful

    I figure in another 12 or so years my kids will be grown and out of the house and my wife will finally stop talking to me. Short of that I figure I'm sill "practicing" my craft till conditions become ideal.

    Even after ten yeas of marriage my wife still doesn't "get it" that each interruption costs me at least 20 minutes to get back into the groove. Thank god the programming I do for a living isn't really complicated.

    I find my ideal times for working are from 10am-noon and 5PM to 1AM. Not particularly good when you have a family.

    --
    "God fights on the side with the best artillery." - Napoleon, Marshal of France - speaking truth to power
  9. Re:Window, not windows! by deadmonk · · Score: 4, Insightful

    Bah! Screw daylight. The Zone in which good things happen (for me, at least) is one in which just about any marked input to the senses is reduced - the room is warm enough to be comfortable sitting still, no bright light to distract the eyes and ambient tunes to cover rude neighbors or people in the hall. My penchant for darker inside offices (no glass) earned me the title Caveman in at least one past position.

    The key here is four walls and a door. I've heard the lame excuse that 'an open environment promotes communication' - what you end up with is being pinned like a bug under glaring lights listening to the dork in the next cube yack at his wife eternally. Sure you can communicate until you're sick of each other, but nobody can concentrate on code..

  10. Comfort zone by tz · · Score: 2, Insightful

    In the afternoon or evening, I can get in the zone almost immediately. And I can often stay nearly indefinitely, as long as I'm not forced out. I can handle only so many interruptions - the worst are those that pose another problem that I can't immediately work on but can think about. My mind will try forking and multitasking. Other interruptions are less severe (to get something to eat, etc.), especially when I can control when to do them - after finishing a major section instead of in the middle.

    An office with lots of linear desk space to each side with a printer nearby (which supports the HP small lineprinter font) and highlighters (when I refactor, I usually take the listing to another room and start marking). A nearby caffeine supply, usually a large cup of coffee, or something else so I don't have to feel thirsty. A way to silence my phone or otherwise insure only critical calls get through. Basically freedom from external or internal distractions.

    A large, LCD screen. Something like the Apple 22" Cinema is optimal, but a large CRT with subdued lighting is also OK. I want to see several pages of information onscreen. Overlapped or iconified windows don't count. Otherwise subdued lighting, full spectrum, and/or task lighting. Especially with CRTs - they tend to bloom and blur at higher brightness. A comfortable chair - this might be a posture chair or stool. The idea here is to prevent fatigue, generally, and from having to fiddle with the UI to view what I need to.

    A reasonably fast computer. My train of thought derails if I break too often. The toolset I use is fast at grepping or otherwise searching and editing and recompiling. When I finish with a set of changes I should be able to keep focus.

    Flexible time. Some people are morning people, others are afternoon people. I am a night person. This is good in that I can work productively until 4am if needed, and in fact I can't sleep much earlier if I keep thinking of solutions or things I want to try. Often I can keep going until I finish something then realize how tired I am and realize that the eastern horizon is rather bright. But if it is too early, I can't get started. I can find 60 ultraproductive hours per week, and sustain that, but few of them occur between 9 and 5.

  11. My own list.. by Forkenhoppen · · Score: 2, Insightful

    I find that, of all things, listening to cheesey pop music, or something with a good beat helps me function through the day... though I should point out that the main and major component that gets me in the zone is headphones. Get yourself a good pair of high-quality headphones, and only wear them while you work. Pump something through them that'll keep you awake, and the blood pumping, preferably something either without lyrics (Crystal Method, maybe Moby) or with really stupid, cheesey lyrics that you've heard over and over again already. (I prefer Aqua myself.) If a slow song comes on, take a break! Just the fact that the song has come on will have already altered your mood, so take the break while you can. (Unless, of course, you're really in the zone, in which case you won't care and you'll just skip ahead..)

    I should point out that if you're using winamp, you really need to get one of those hotkey plugins so that your windows-c is mapped to pause and windows-b is mapped to skip ahead. Otherwise, you'll spend too much time when skipping the slow tunes, and it'll knock you outta the zone. (Besides being helpful in skipping songs, it'll also help if you're too deep into the zone, and really need to think about something.)

    Last thing I'll mention; water. Make sure you have water nearby, and you're drinking it. Besides it being healthy for you, keeping you dehydrated, and keeping you from drinking caffiene, (which despite what most people'll tell you, will actually drain you of energy and shorten your zonage) it'll also force you to take regular breaks (to use the washroom) that won't affect your zoneage! (I have discovered that this is perhaps one of the few ways to force oneself to take regular breaks that doesn't continuously break my zoneage. As amusing and silly as it may sound, I highly recommend it. : )

    So anyways, to summarize, my tips:
    - good high-quality headphones
    - up-beat music (not too up beat, though; avoid raver stuff that messes with your aural depth perception; it'll just distract you..)
    - good winamp plugin for hotkeys
    - water!

    Oh yeah.. and I find that being in a bad posture helps too. But I'm not gonna recommend that to anyone; I'm already experiencing the negative effects of that one, so..

  12. Re:Crystal Meth by grmoc · · Score: 3, Insightful

    you forgot the od-
    Crystal MethOD ...
    =)

  13. Entering "Zone" by MegaGremlin · · Score: 5, Insightful

    For me, maximizing my time in the "Zone" is dependant on one major thing - physical fitness. The more energy I have, the longer I can work - and work well.

    I have a fairly easy system for achieving this.

    1.) I get up every morning at 5:00am and run 3-5 miles,
    2.) Shower (very important step, do not omit.)
    3.) Eat a good breafast (generally a piece of fresh fruit and some "healthy" cereal.)
    4.) Eat a healthy lunch.
    5.) Get out of the office during lunch, for a mental break.

    I avoid artificial stimulants at all costs.

    I find that I generally have much more productive time than the other people in my team, and don't spend 10 minutes on the hour servicing a coffee habit. My mind is clear all day. I don't suffer from the afternoon slowdown.

    Granted, I do fall asleep fairly early in the evening (around 10:00pm) but I provide more work to my employer, on a time schedule that is convenient to him.

    Think about that when the next round of layoffs begin.

    --

    .sig
  14. Programming or truly creating? by Ledskof · · Score: 2, Insightful

    I can understand the need to get into some kind of perfect frame of location to go with your frame of mind, but the kind of stuff I program at work are simple straight forward network tools. It would be about as necessary for me to have the "zone" set by live strippers and James Brown to write network tools as it would for me to an LDAP search on an orphan in our Active Directory.

    A lot of angles come into this as well. Some people really need to focus on something to be able to learn it. Some of us don't, we just read the syntax, try the code, try some sample code, and see how it works, then use it. Generally it comes back to how well you know your language I feel.

    But then you have to work out a problem that is damn right crooked. There's no straightforward apporach to it, perhaps because it's never been done before(I haven't found a project like this yet). Or maybe you are just trying to code something and you aren't really looking for any help from those who have mastered it. So you crank up the legs on your lazy boy, get your Spinal Tap on the stereo, get 3 live llamas standing around you, yank out your prised microsoft split key keyboard that reduces yor typing speed by 60WPM, flip on your pride and joy 21 inch ultra barrel screen mitsubishi 12 year old monitor, and then you are finally ready to code gorilla.bas, without help of any kind. Just you, whats in your head, and maybe an old turbo basic book by Sams.

    --
    This is my sig. The post is over.
  15. Re:Here's how I do it. by Anonymous Coward · · Score: 1, Insightful

    And for me, a big bag of weed!

  16. Look a little further, guys. by Lurgen · · Score: 5, Insightful

    I thought long and hard before posting this comment... it's a bit on the harsh side, but being a part of the IT industry, I feel I'm entitled to offer an observation (as most /. readers are!)

    There are far too many IT employees, especially programmers, who are under the misconception that they are something special. There are many industries and jobs that involve enourmous levels of creativity and innovation, however I can't think of many that contain so many whining graduates.

    Take teaching for example. Every day, a teacher is required to educate their students. They don't get the option of saying "I can't find my zone, I'll be back in a few hours". The don't have the option of rearranging their working environment to suit themselves (as opposed to suiting their students/team). Sure, you can point out that teachers are generally following a process that is predefined... so are programmers though.

    Looking back within the IT community, take a look at the higher level support engineers. When a server farm catches fire, triggers the sprinklers, and dies a gurgling death, do you really think it would be appropriate for any of them to say "the room just doesn't _feel_ right"? Nope - they have to get the job done.

    Programming, for the most part, is a case of following the yellow brick road. The road is paved by your team leaders, in most cases, and when it isn't there is very little stopping programmers from following the processes and methodologies they claim make them special ("I have a DEGREE!").

    And what about childcare workers? Have you ever considered what it would be like working in an environment totally designed in favour of creatures half your size? I happen to know one or two of these people, and let me tell you that they never bitch or moan about their working environment not being ideal for their "thought process"!

    Face it - we're nothing special. We carry out a job, and not a very hard one at that. Sure, once in a while we need to demonstrate flashes of brilliance, but based on the ones I know, the vast majority of IT workers probably shouldn't have jobs in the first place.

    Be grateful you have the opportunity to work in a field that pays well, offers good working environments, decent job security (those who lie to themselves, and believe that we are any less secure than the rest of the world are fools), and cool toys to play with. Personally, I feel lucky to have the opportunity to work within the field.

    (Incidently, I sit in a cubicle that is rather small, at a desk that isn't particularly comfortable, with a window behind me that casts glare all over my screen, in an open plan office. I can hear my team chatting with their wives, the aircon is unpredictable, and the lighting annoys me. But I get to work in a field I love. Personally, I think I'm winning here)

    1. Re:Look a little further, guys. by Anonymous Coward · · Score: 1, Insightful

      Sure, we're not rock stars. But the point of the article was figuring out how we can produce clean, readable code more often.

      Sometimes, I'm not in a mental state where I can produce a multiple data-input format plus multiple storage format server daemons that can be easily scaled across multiple CPUs/Boxes. Sometimes I am.

      But just because I'm not in super-programmer land doesn't mean I just sit around or become unproductive. I try to put myself back in super programmer land. I read slashdot, freshmeat, cnn, my newest language ref, a book on algorithms, or go have a roadmap meeting with the CIO.

      I've seen the product of people forcing themselves to program when they aren't in the mental state (I'm just as guilty) and it is usually inefficeint, unreadable, and/or unworkable.

      The key is figuring out what allows you to work more effectively, and be effective when not programming. I (and my boss as well) think that expanding my knowledge of things IT is nearly as beneficial as actually developing/repairing/whatever your job description says.

      But, you are right in the fact that NO ONE LIKES WORKING WITH A ROCK STAR.

    2. Re:Look a little further, guys. by Piquan · · Score: 3, Insightful

      You demean all programmers by implying that there is no skill spread between them.

      And any programmer who thinks that a Programming Methodology that was handed down from On High (defined as either somebody with an MBA or a PhD) is good for all things, is in the wrong line of work. It's a craft, not a skill.

  17. Creativity, Productivity, Drugs, and Clock Signals by drenehtsral · · Score: 3, Insightful

    Okay, here's how I view it: If you have joe random programmer, there are several factors at work. First, you get your problem spec. Somebody higher up says "hey, we have this information, we know it can be processed into this smaller set of more immediately applicable data, and we need something in the middle to sort through reams of data, find the relevant points, accumulate them in a database, perform some analysis, and spit out a condensed set of results"...

    Okay, now there are lots of ways you could go about this. First there's brute force, there may be a simple way to do it, but it's not ideal because it's O(N^2), okay well there are several routes you could take. First, you could run with it, second you could think about it, possibly for days, while you may be reading the morning papers, your subconscious mind is churning through multitudes of different solutions, working on what would generally be considered intractible topography problems in th' background using the massively paralell computer known as the human brain. When you finish with that stage, and you're ready to implement, then's when the groove hits.

    What i'm talking about is when there is a hairy multifaceted problem, and after goofing off playing tradewars for a couple days, you finally latch onto a solid solution. What looked like a massive unmanagable mass of special cases and state variables condenses into a simple but subtle loop invariant and you go for the gold. Pop a couple of ephedrine, drink some coffee, eat a bunch of solid high calorie food, put on some good driving music, something with a solid steady beat that you can use for a clock signal to push the data through your brain, and let fly. It's one of those things where you have solved the problem on a subconscious level, and you can see all the facets and details as it if were a building in front of you, except instead of a building, it's a nice regular 5 dimensional shape, but it's there, and for that moment in time you see it clearly, and as fast as you can code and comment, it can be translated back into our mortal plane, it can change from a shimmering but abstract represenation of a problem into a concrete solution. That's where it's at. =:-)

    --

    ---
    Play Six Pack Man. I
  18. Re:EXTREME PROGRAMMING! by Anonymous Coward · · Score: 1, Insightful

    Some (a lot of?) managers think extreme programming is to team up experienced with in experienced coders. This is wrong, stupid and will piss of the good programmers. Point is that you should be equally good so that the co-driver only has intelligent and productive remarks. One must work as a team and respect each other, this won't work if you think the other guy is a moron.

    This way you can spot errors faster and find new ways to solve problems. Probably won't work for everyone anyhow but it's good if it's implemented right.

    /J

  19. Re:EXTREME PROGRAMMING! by pathwayX · · Score: 2, Insightful

    I have to agree with this and add that it has to be a developer that's ...compatible with you. You know how you sometimes work with somebody else and you can't get along no matter what? Not just on a personal level, but code-wise. And then you work with someone else, and you think /so/ much alike, that when you take your separate pieces of developed code at the end of the day and try to integrate them, they just fit like a jigsaw, on their own.

    I find that when paired with a person like that, we can whip out code like nobody's business. We also inevitably end up drinking Guinness while coding, but I think that's a fringe benefit. (Mental note: Conduct tests concerning the zone with and without guinness. Report on /.)

    --
    So long, and thanks for all the fish
  20. Re:Creativity, Productivity, Drugs, and Clock Sign by Hellkitten · · Score: 2, Insightful

    the zone, that trancelike state when time stops to matter and there is only you and the code. How do we get there?

    This is what works for me: in order of importance

    A challenge: The task at hand has to be difficult in some way or another. If it's not then you can still do it but you don't get 'there'

    Coffe. Black. Strong. Close. Hot but not hot enough to burn my tounge and throat when i gulp it in a not quite conscious motion

    Nicotine. I may not go to take a smoke while i'm on a roll. But I have to be able to or I'll get distracted.

    Light. Dim. At the least it shouldn't reflect off the monitor

    Music. Preferably repetive with a heavy bass. The most important thing is that I've had to have heard it a thousand times before, so that I don't hear something unexpected and 'snap out'. Pity I can't do this at work because it might distract the others. Also headphones is a big no no, since they either slide off or are too tight and hurt after a while.

    Air, fresh but not cold.

    Something edible. So that if my stomach manages to get through to my brain i can silence it fast

    --
    - We are the slashdot. Resistance is futile. Prepare to be moderated -