Programming is like juggling.
When I'm coding, I usually have Chrome, Transmit, BBEdit, Kaleidoscope, and the developer inspector in Chrome all open at once. I have gotten myself into a mental state where I am troubleshooting, which CSS class or id is influencing which object on the page, trying different parameters or structural hierarchy to manipulate the object on the page into doing what I want it to do.
I'm usually also listening to an audiobook or podcast with my noise canceling earphones on, to block out noise and minimize distractions. You see, music is too repetitive and my mind wanders, but something in the background to listen to keeps me thinking while I'm thinking. That might not make sense to anyone but another developer but just trust me that it matters.
I have both hands on the keyboard or keyboard + mouse and am using 2-4 programs at once with overlapping or side-by-side windows so that I can quickly switch in-between them.
Again, programming is like juggling. Remember that.
We have an open office environment. I hate it.
Open office environments tend to give people the false impression that it is okay to wander about the office and stop from cubicle to cubicle to make small talk. For me, each time it happens, I have to un-pause my audio, take off my headphones and completely set down the 4-8 balls I have up in the air at the time in order to see what the person wants. Sometimes it is for a legitimate reason - they have a question that is necessary to communicate not over phone or email, but in person. That's fine. I understand that.
But remember, programming is like juggling.
Occasionally, only about 6-10 times a day, someone will come up behind me. I hate this, and usually because I'm concentrating to hard, it's akin to someone sneaking up behind you in the dark and screaming "boo!". Sometimes they come around my cubicle to stand on the other side of it, facing me, so I can plainly see they want my attention. I sigh inside my head. I un-pause my audio, take off my headphones. The person just stands there with a smile on their face. Finally, I ask, "Yes?" to which they will just wave and say, "Oh, just wanted to say hi." They turn and walk off.
Programming is like juggling, and open office environments are like trying to juggle in the middle of a day care center where the toddlers keep walking up to you tugging on your shirt every 5 minutes to ask you to watch them do a somersault.
If you work in an open office environment and one of your co-workers who is a developer has their headphones on and it appears there is code on the screen at the time, please don't disturb them unless you have a good reason. Saying "hi" is not a good reason.