Recently, I've found my concentration is becoming increasingly bad. I blame this mainly on co-workers and the internet keeping me from things that I need to get done (it's hard to program when I can only keep focus for about 10 minutes at a time).
What are tips/tricks you use to help "build" your concentration?
2. You should have 2 modes: coding and not coding. For coding, you should be at your desk coding. For not coding you can be anywhere, but not at your desk. One of my biggest problems is that I often find myself in one mode when I should be in the other. If you're having trouble writing code, then you probably don't know what to write. Grab source code listings, pen, & paper and get away from your computer. Don't come back until you know exactly what you're going to be working on. Better yet, until you're dying to work on it. OTOH, if your doing analysis and are stuck, stop. Go back to the computer and code something, anything small, just to get going.
3. End every day in analysis mode. Don't go to sleep until you have tomorrow's plan ready. You should wake up knowing exactly what you're going to be working on and excited to do it. More about that:
http://news.ycombinator.com/item?id=191275
4. Never text or IM when working. Have the cell phone nearby only for emergencies. For email, go to the other computer once an hour (see #1 above).
5. Try 48 minutes on, 12 minutes off. For long coding sessions, this works pretty well for me:
http://successbeginstoday.org/wordpress/2006/09/the-power-of...
6. Ipod.