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.
Window please! A real window!
Optimal condition is:
* Rather dark and gloomy room
* Big monitor at high resolution and many xterms prepared
* Huge MP3 playlist set to random
* One big cup of coffee (machine close by)
* Unlimited supply of colas in the fridge
I'm at optimal performance just when I normally should go home from work. Or when I work home, just before I really should go to bed.
Ciryon
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.
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.
I hate to tell you, but coding isn't like writing a novel.
You're a VB "programmer," I presume?
Bush Lies Watch
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.
Need I say more?
What are the major interrupters?!?
Hello??
You just asked the major interrupter!!!!
I stole this Sig
...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
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.
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.
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
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) + (&)
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.
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...
- 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.
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
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....
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.
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.
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.
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.
The phone has to be one of the most distracting elements in the modern office. If you and your team use an instant messenger instead you can really cut back on the distraction factor. I find I can hold my concentration better through a chat session than a phone conversation.
And stack your meetings on particular days if at all possible. This is often difficult since in many office cultures the managers proclaim meeting times and the workers learn to live with them. But if you have a choice then try to put all the distractions on the same days.
And for all you managers out there don't schedule a meeting that ends close to the end of the day. If the meeting ends at 4 and most people leave at 5 chances are your workers are doing only two things between 4 and 5: jack and shit.
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
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.