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 can't sit down and program for hours unless I have a good chair.. I have to feel as if I'm sitting on nothing.. Uncomfortable pressure points will surely annoy me the entire time I'm attempting to program. It's the key to getting into the zone entirely.
Next to that is a good mouse (if you're doing any GUI work or Graphics with the program) and Keyboard that has that great feel. It's different for everyone, I like my keyboards to click where I can feel I've hit a key. I find I have less typos that way.
And finally, ample supply of drinks and snacks readily available within an arms reach, otherwise I'm forced to break my concentration to get up and to refill my drink or snack. Some good music helps too, with headphones if you aren't alone, it helps you tune out the rest of the world around you.
..There's a-dooin's a-transpirin'
Probably my biggest issue is with noise. It could be my farely ADD-type tendencies, but almost any noise beyond what is found in a normal office environment makes it really hard for me to work. Music may be great for the mood, but I just can't work unless the music is classical or something else really light. Also, if I have an office near a window, it could be a problem if the the windows aren't soundproofed enough and I have to listen to the conversations all the smokers have on their breaks.
The future isn't what it used to be.
You obviously are not a coder. Coding is much more difficult than writing a novel, in complex programs it can be very difficult on how to implement functions. You definately have to be in a certain mindstate to do it, depending on the complexity of the issue. Sometimes the fact that it just needs to be done, isn't enough for you to have the concentration to work on the more difficult problems. Often I find revising a flowchart on the issues, making them look easier, gives some motivation. However, there are somedays where I just can't get into the mindstate, and thats when I do physical chores. Sometimes coffee helps, but for motivation doesn't last long, and you crash hard after it wears off.
First, thats off topic -- but I'll comment anyways seeing as i like how my keyboard is being nice and tactile right now (an effect of enviroment).
The discussion is what makes you more efficient, not if you can or cannot complete the task. We all know that non completion results in bad things, this is about doing it faster and/or better.
Coding isnt like a novel, but in a way coming up with a plan for coding is. This approach (your word) is the hard part, coding is just dry implementation.
"The Zone", be it based on enviroment, or whatever gets you going, is a necessary component in effective coding.
Essentially formulating the solution in your mind is coming up with the theme and plot of a novel, and implementing is like scratching it to paper. Though not equally demanding of non-interrupted time, both do require that special something to be done right.
well... the one thing I find, is that my monitor can't be near a wall... ie, I have to have it so that, when I look past the monitor, I don't see a wall right behind it. If I do, I find that my creativity tends to hit a block. If there is no wall, it tends to flow a bit, and circulate around the room (much like a virus? perhaps). Strange? Maybe... but it works.
Music wise... it has to be something that doesn't require active listening, but it can't be boring either. Classical and opera tend to work very well as good background music. If it's a game I'm coding, I'll usually put on the soundtrack to a game, as I find that gets me thinking about games, which helps me to make the game.
Finally, the chair is something I don't have a preference for. As long as I can sit it, and don't find myself fidgiting too much, it's good enough.
I too am a developer (for 8 years).
From college CS on, I have worked best from about 11PM to about 4AM with blaring techno (Richie Hawtin, Cari Lekebusch, Christian Vogel, etc). However, I will never be able to reconcile these habits with my current employer. So, I estimate my schedules given my current productivity, and if needed I work during the day, and then work later at night. I'm certainly comforatable with that.
Working those odd hours does not enable the company to manage me effectively, and I can't be a resource for my fellow employees. If I signed my paychecks it would be a different story.
there are set ways to approach and solve a problem
Yep, generally.
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.
So I take it you love solving known problems with 60hz florescent lighting flickering in your eyes while your cube mate pounds out high-decibel "Cirque du Soleiel" music and your folding chair stabs you in the back? Are you sure you aren't a robot?
Programming is a mental activity. It is thus appropriate to make all distractions disappear for the thinking individual. For some, special music (ambient!), good furniture, and good lighting are essential.
And to hell with a window. Hands up everyone sitting in a beautiful office with cardboard taped to the monitor and large objects sitting in the window to avoid being blinded at 3pm sharp.
When programming alone, I find that the "zone" is an elusive beast that can be found for about an hour or two each day, on average. Some days more, some days less.
Pair programming, a subset of extreme programming, largely eliminates this problem for me. When I pair up with another developer, I can regularly find the zone each day and stay in it for 4-6 hours. 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.
Ok, on the whole I like dark lighting, private offices, headphone music (classical). But I'd sell all of this for one thing. Leave me alone. It takes me up to 45 minutes after sitting down to really get into what I'm coding. If I have an interruption every 30 minutes I will get nothing done. Of course it's very diffucult to structure an environment where people can ask questions when they want without bothering all of the other coders who are in the zone. Here's some ways to make this easier:
* set up an irc server or get everyone on IM. If you have a question, IM it to somebody instead of interrupting them with a phone call or personal visit. If they are in the zone, they can wait until their train of thought winds down to answer.
* Catered, delivered meals are a diabolical way to squeeze more zone time out of your employees. Nothing is better for me (and the company) when somebody brings in a bag of burritos when I'm in the zone. Delivered dinner is the best way to explioit me for more unpaid work.
* Good CM and documentation limit the amount of interruptions because people can consult the docs instead of, "Ask Bob, he's the only guy who knows how that works."
* Let me work funky hours. We've got one guy who gets here at 7:30 AM, another who shows up at noon and stays till 10:00 PM. Why? Because there are large chunks of time where nobody is around to interrupt them. This can wreak havoc at your company if you don't do the above documentation, but it can work out very well if you do.
Yeah, private offices, screen real-estate and Aeron chairs are cool, but I'd throw them all away for a full day without interruptions.
In bug fixing state, I can multitask efficiently between multiple small size tasks, do them together, answer a question in a middle, etc.
In development state, I am really concentrated, and if someone asks something, it is very difficult to concentrate a sudden support question, and if interrupted, it takes time to get really back into development state.
If the development state is difficult to reach, I need music. Something heavy, Metallica seems to work best.
Absolutely, I used to have a pair of those $100 Sony Noise Cancelling headphones (before I stopped travelling 38 weeks a year, and after my dad stole them from me) that I would wear without a cd-player sometimes just for the noise cancelling. They could turn a 737-500 with a screaming kid next to me into a very quiet relaxing environment that I could read without distraction in.
The Bose headsets look REALLY nice, and I'm thinking about gettting a set, but I work from home now, and am alone listening to techno or a dvd, which is the optimal work environment if you ask me.(B) + (D) + (B) + (D) = (K) + (&)
* a source of music just loud enough to block out office noise, but not loud enough to make me notice it. (If it's music I really *like*, I'm in trouble, since I'll pay attention to the music.)
* A phone with a ringer that I'm able (and allowed) to shut off and/or let calls go straight to voice mail.
* an email client that I'm allowed to configure to not notify me of arriving emails
* a cubicle out of the way of major foot traffic
* orientation in the cubicle so that I don't feel that people are looking over my shoulder (I don't care if i can see them coming -- what i hate is the feeling that i'm being "vultured" -- a sure fire productivity killer for me).
* the ability to get up, walk around, and think through things. given a 5-minute walkaround (not, mind you, an excuse to visit my neighbors), i can begin to get in the zone before I start coding / debugging / whatever.
phone and email are the worst -- especially when they're combined with a mandatory response time standard set by the company.
mmm... yeah... You see, we're putting the cover sheets on all TPS reports now before they go out...
There are set ways to approach and solve a problem that has already been solved! If you are solving the same problem over and over again, you aren't doing a very good job.
I prefer to make my code reusable, as to not have to ever solve the same problem twice. Of course it rarely works out, but I try.
How long does this last? This often depends on a few things also:
When am in The Zone, it is a curse. I can't think of anything else but what I'm hacking on. (This is a problem when I am hacking on a personal project and go to work.) I usually just have to ride it out, keep hacking, until something happens that I put the project aside for a while, and then I usually repeat the whole process again in the future some time.
So that's how it works for me. :)
Jason.
- Dont laugh - I got the music midi files from descent 1 (the game) and have been coding to that - brings back memories from when programming wasnt work
- Comfy chair!
- 19" or greater monitor!
- Code when you want/need!
- Code at Home!
- Take your fav keyboard & mouse along with your laptop
- When you get an idea, GO AFK, once the idea gets some time to ripen you'll be all charged to tackle it
But most of all make whatever you program a positive experience for your users. There's nothing like a "wow dude well done" from a happy user.Of those to whom much is given, much is required.
Lately I've been having some intermitent trouble with the anti-zone; where you just can't get jack-squat done. You hit slashdot, Usenet, go through various sites, anything but the task as hand.
I'm getting it under control, but sometimes there's just this huge inertia you have to overcome. But luckily that's intertia in both the difficult-to-start form AND the easy-to-keep-going senses of the term.
SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
I work from home and code on the ground. There is something comforting about being close to the earth.
I don't see how people can code while sitting at a desk for 10 hours straight.
All I need is a bean bag, a six pack of diet pepsi, and a few exercise 'pep' pills with ephedrine (I ususally code after working out....yes there are bodybuilding geeks out there).
If you get tired you just mute your computer and plop your head on the laptop. I promise you that it is PURE joy.
Don't knock it till you try it....
One more thing -- I'm not a programmer, I'm a military technician. In some ways, my job is more like a Surgeon's job than a "coder." And, yes -- I am a professional, and yes, I do get the job done. Regardless of time, day or night, whether I've been up for 18 hours or 3, whether I got a good night's sleep the night before, whether I have nice music to listen to, etc... you get the point. But... if I've gotten that good night's sleep, if I've had the time to relax, think through the problem(sometimes not an option -- tactical situations don't have a lot of room for downed equipment), I'll have a much better response to the problem, and I'll be better able to come up with the most expedient solution to get the equipment operational again. The point wasn't being a professional -- the point was how your environment affects your productivity.
I do not read or respond to AC's. If you want a discussion, log in. Otherwise, don't waste your time.
Althought the parent was modded funny, I have to add my 2 cents - I like to code, but I'm not a marathon sit-at-the-pooter-for-2-days-straight kinda guy, like a lot of the people here are. Except when I have to, and I get a little speed. A small dose of speed (usually drunk in a shot of water, enough so you barely notice you've taken any) actually works wonders for my productivity. When the deadlines come up, it can often help me work all night at home, then go to work and work all day, and still be doing something useful until 5 o'clock.
;-)
Good stuff really, although we should be thankful it's illegal or we'd all have 25 hour days all the time
Send lawyers, guns, and money!
Hahah, you aren't a programmer are you? Probably are a poorly paid manager.
Truth is, I have yet to find ANYONE (thank God) in a position of any managerial importance that agrees with you. Everyone I've ever known recognizes that there are days that a programmer just can't crank out code, and there are days that in a single day he'll crank out 4 days worth of "slow days."
Programming isn't an exact science. It DOES require being in "the zone."
When you're in the zone the code will just flow and it'll normally be much better code. A programmer who isn't in the zone but feels "forced" by management (or, more often, by himself) to crank out code will produce poor code, will have low morale, will probably tend to take a long lunch break and probably frequent "cigarette breaks," and probably leave right at 4:30pm. Basically an unproductive day whose output is of little value.
On the other hand, a programmer that is in the zone may easily forget about lunch or eat his lunch in 5 minutes at his desk while he codes. He might remember to go to the bathroom. And it is doubtful he'll leave before 5pm. And the code he produces will be some of his best.
When I'm not in the zone, I tend to do non-programming work. Returning calls, writing up documentation, meeting with those that may have been wanting a meeting for some time. There's no reason to waste time on programming when you're not in the zone.
If you really think it's as simple as "pay the programer and he'll produce 500 quality lines of code a day, every day" you're sadly mistaken. While you can't have a non-productive programmer and being "out of the zone" isn't an excuse to avoid working, it is equally unreasonable to expect programmers to be 100% productive every day. Aint gonna happen. Some days they'll be at 50% and other days at 150%. Every manager I've worked with or for knows that and accepts it.
I suspect those that don't know or accept it are hiring code monkeys in a sweat-shop environment. I've never worked in those environments, though, so I wouldn't know.
I spent 2 weeks trying to figure out how to keep the horrible glare from the sun off my screen. We have these pin-holed blinds that allow enough light in to burn out my eyes, and my boss doesn't like it when I stack up a bunch of boxes to block out the light... I've had to move my huge and unwielding to an ergonomically suboptimal position so I can stand to look at it during the day. People always joke that they can find me a windowless cube, and unfortunately they always think I'm joking back when I tell them that I would love it.
Paul Erdos (sp) the prodigy mathematician was famous for his daily intake of speed and Retalin (sp). Also in post WWII Japan speed became a national staple and was widely and cheaply available. While the productivity boost helped propel Japan in to an industrial, world leadership role, the speed intake also contributed to significant health problems and was shut down.
We're, metabolically, biochem plants just churning out one upper/downer after another. We just haven't fine tuned the pharmaceutical industry to our productivity needs but we're getting there. In the alternative a good work out will pump out enough endorphines to brighten anyone's day.
cheers"Academicians are more likely to share each other's toothbrush than each other's nomenclature."
Cohen
The most important thing by far is the state of mind you have going into a long hacking session. I find that if I don't have the right state of mind to tackle a project, I will find ways to not work on the project. Deadlines seem to be one of the ways to force me into the right state of mind, but otherwise, I prefer to just queue up all my music, put it on random, and let it fly. I dont like coding in the dark because that means it is harder to find/use any resources I have laying around. I draw things out on paper to solve problems, and doing that in the dark is a good way to kill your eyes. A lack of background noise is disturbing. In fact, the lack of music playing right now while I type this is killing whatever state of mind I had while I was trying to knock off some problems.
When I'm faced with "coders block" I high-tail it out of the office jump in my VW Passat. Light up a cigarette, turn up the stereo and drive.... On truly productive days I do this 2-3 times a day. The tricky part is getting back to the office in one piece and without a speeding ticket once the solution comes to mind... :)
I tell ya this.. there is nothing better than "The ZONE".... a dark room.. or better - deep night.. no phone calls.. no ppl comming or disturbing... the city is quite.. (if you live on some countryside the birds a singing.. the dogs are barking... quite... you're listing to some deep relaxed ambient (or whatever you like)... you hits the keys almost without thinking.. ... you coded in 3 days more than normally you would do in two weeks.. and it's a real value... you took just one day off and got back cause the code called you...
.. I took just once 5 days of holidays during that time.. and mostly I slept it over.
..
The code flows... and flows.. it can't stop.. it just flows.. you don't eat.. you don't sleep..
You came to work at friday morning and now it's monday
I was working on some big project.. My part was like 50.000 lines of code... 14 months of work.. and I mean *work*
We had a good schedule and we kept our checkpoints.. well mostly.. but at the end we kept the deadline and the project was done in time and was really high quality - very few (when you compare it to the size of the project) bugs which had to be later fixed.. and none of cirtial mass
We got the money, the customer was very satisfied.
It was one the best time I've ever had, I was the most productive man on the World.
The point it: let ppl work as they want, if somebody wants to work in the cave - buy one.
Give freedom to people and the do really good, first class stuff.
The trick is to do a good schedule with checkpoints and you will see for yourself on the paper, if this model is going to work out or not.
After reading about people who've had a positive experience with herbal remedies, I decided myself
to try a few. Ginkgo, in particular, is popular for increasing mental focus and memory; Ginseng too
has a simular but more subtle effect. Wow! what a difference they have made, I'm now able to concentrate
on a problem without losing focus for much longer, and my overall mood has improved. Seriously,
give them a try; at worst they don't work, there haven't been any side effects associated with either.
Here's what I find works well.
First, be sure you have something to hack! If you don't yet have a design ready, you have no business at a keyboard. Walk around the block, or sit down in the break room, or do something, but relax and meditate on your design. Don't compromise. You'll know the Right Thing when you have it. Then, you're ready to sit down and hack.
Now, on to the environmental issues.
Comfortable chair. I have an Aeron, and don't really see a difference between that and any other good computer chair.
No glare! At my last job, we were fanatical about closing the blinds when the sun started coming through them. (The window faces West.)
Low lighting. At work, after six, they turn off most of the lights. There's well enough light to be safe, but much less than normal in an office. Overhead florescents are evil. Eyestrain, flicker, icky things. With the low lighting, desk lamps are mandatory. Florescent is okay there, since it doesn't illuminate the monitor. Make sure the lights work properly. At home, I use a single 60w incandescent and a lava lamp.
Descent sized desk, with bookshelves. Being able to have schema diagrams, language references, etc. arrayed for easy reading while coding, without having to constantly shuffle things on your desk, is very important.
General ergonomic concerns. Don't make the coder uncomfortable if he's going to have his butt plastered to that chair for a while. As keyboards go, I can code longer with my Maltron than my QWERTY (yes, I've identified this as a trend), but this is more personal taste than anything else.
If your company tends towards phone over email, be sure to have a Do-Not-Disturb button on the phone! With all the biffs out there, there's no reason that somebody trying to concentrate can't put off a request for a half hour while they're juggling eggs. (My phone hasn't rung in some four months, so I don't even know if it has a DnD button. If it's urgent, you page me. If not, you email me.)
Music. I personally prefer Celtic, Metallica, 80's, or FPS soundtracks, but this is *so* personal, be sure to experiment and find what works for you. Wireless headphones are a Godsend in an office environment where speakers are unusable. Never get an MP3 player without a repeat-all function.
At home, I frequently hack well with the TV on. I leave shows I've already watched on the TiVo and put either them or a DVD on. It should be something you've recently seen. I also have good luck turning Emacs translucent and watching DVDs through it. Music video DVDs are great.
My company has free bottled water and a selection of juices and sodas, always stocked, on each floor. Very good. When you hack for six hours in a row, you can get dehydrated too easily. We save money on water by giving out bottles (in koozies so people keep them) and having coolers. Get out the bottle or can before you sit down to hack. And think about water instead of soda; it really does work! (And this is coming from a die-hard Coca-Cola addict!)
If you're close to a meal, consider postponing your hack session until after; catch up on email or fix some quick bugs first.
A lot of people have talked about screen real estate for lots of xterms. I don't get that. I have Emacs, and that's it. But I write a lot in Lisp, where 99% of your time can be spent in Emacs with an Emacs window on the Lisp interpreter, except for when you're doing GUI design. In fact, a lot of the time, I work in console mode instead, to get rid of distracting window manager stuff.