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.
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.
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
...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
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.
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.
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.
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.
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
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..
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.
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..
you forgot the od- ...
Crystal MethOD
=)
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.
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.
And for me, a big bag of weed!
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)
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
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
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
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 -