I already know that I spend too much time on things like Hacker News. (Which is why I take ironic and self deprecating usernames like unimpressive.) Reading, while helpful, isn't helpful past a certain point. The problem is that reading feels just as helpful when you need it as it does when you don't.
It's certainly easier to do something after having read about it. But how much can you really do, and how much of it is truly relevant to your goals? You can't help but feel that not tapping into powerful tools like RSS feeds is damaging in some way. Intangible as it is.
I find that it depends on the project, but there have been times when I am so focused I start coding in the shower. Then proceed to forget to eat breakfast... lunch... and dinner. I just forget about my body.
That have not happened to me even once. My brain needs too much sugar to function propery and if I miss a meal he won't work at all. On the other hand I can easily disconnect my body from my brain while riding my bike and forget completely about eating & drinking. When I reach my limit I faint, stumble and fall.
How do you value inspiration or innovation stemming from distractions? I'll go on a limb and state that distractions can be more productive than zen coding...
This is probably the fundamental reason that I don't just turn off my RSS reader and uninstall my web browser. Those distractions are the fuel for the fire that keeps your finger on the pulse of doing awesome things. The issue for me is justifying to myself the potential cost of missing a critical piece of information that might lead me to something brilliant.
I think it is great to be distracted to be inspired, BUT when inspired, without focus you will never realize all the great thoughts.
It's the same thing my yoga teacher told me - when you do anything - you have to focus as hard as possible, as long as possible. Then re-focus to other thing and never float like a leaf on pond - this won't get you anywhere.
What if our brain is actually a multi core machine that has millions of cores? Would you still force it to use one core?
What if the task you just put into background kept working on it's own?
I think humans were built to multitask, our environment is too complex to be single threaded, think driving: you need o pay attention to multiply things at the same time.
Yes, maybe the question is wrong - it's not about whether or not we multitask. I can't easily occupy my consciousness with multiple tasks, but I can let my unconscious mind handle something (and interrupt my conscious mind when it needs to - e.g. when a car is swerving out of control in front of me) while I perform something with my higher levels of consciousness.
"What if our brain is actually a multi core machine that has millions of cores?"
The brain has billions of cores on parallel units, but they are unconscious.
"Would you still force it to use one core?"
No, you can't use only one at all, but you use "the one",the conscious brain(that could only do one thing at the same time) to coordinate them all, you should "force" the millions of cores to work in the same thing at the same time.
"I think humans were built to multitask, our environment is too complex to be single threaded, think driving: you need o pay attention to multiply things at the same time."
They were built to multi task over the same thing. If you go hunting but you are also thinking on your girlfriend while you remember the taste of the food you ate yesterday and try your nephew does not get hurt you won't be as efficient as someone that focus all their senses and thoughts over one single task.
Software development seems to be something that's very different than what humans were "built" (evolved) for. During the millions of years over which our brains evolved, we had to be acutely aware of our environment so that we didn't get eaten while foraging for food. Driving might be similar to that: keeping your eye out for danger while your main goal is navigating your car to its destination. But that doesn't suggest to me a million-core machine -- it's more like a foreground process with a couple of lower-priority background processes. And adding just a few extra distractions to driving -- cell phones, texting, kids yelling in the back seat -- increases the probability of accidents, which suggests that our capacity for attention is quite limited.
However, software development calls for a very different kind of mental work, one we couldn't have evolved to be good at since our species only started doing it very recently: juggling multiple levels of abstractions in your head along with countless low-level details. That's so hard to do that trying to do it concurrently with other tasks severely degrades our ability to do it. Paul Graham wrote about this very eloquently in his essay "Holding a Program in One's Head" (http://paulgraham.com/head.html).
Fantastic that you believe that. Unfortunately, pretty much all science on that topic contradicts you. There's a metric ton of studies that show that our brains worked best focused on a single task.
I don't compile (web application) but have period of time when I am running test suite and have to wait.
If I have such free time, there is always something else work-related for me to do, since I am not tasked with only coding.
- Go over the code I have just written.
- It is time to commit, so look at diffs and commit.
- Check the server's performance.
- Go over list of pivotal stories and see what I be doing next.
- Take a break, go for a walk around in the building, check out the beautiful view.
- Go over calendar and see if there is anything I need to not-forget.
- Read something related to programming, a book at work or an article.
- Have a talk with fellow co-workers about something that has been on your mind.
"Divide your time into 60 – 120 minutes blocks of work. Focus 100% percent in these blocks of time. Then take a 20-30 minute break and do something else entirely."
This might be usable advice for someone who works at home on his own business, but for those of us who work in office environments, there are sources of distraction that are much more difficult to control than the urge to read news: meetings, your boss walking into your office, colleagues who interrupt you with urgent requests for help, etc. (If you're a developer who also manages a team, multiply this by ten.) The only time I can get an hour of uninterrupted work is after everyone goes home. So I think a more useful question is: how can you get back into a productive state more quickly after the inevitable interruption occurs?
Or, to go back to Zen: how can you lose the attachment you have to the flow of uninterrupted work? When it happens, it feels really good, but when it doesn't happen, it would be better not to get too frustrated about it and be able to move on.
That said, I thought the article's advice to consciously choose stretching or brief meditation over e-mail or news to be something worth trying.
In a larger office, you are usually not paid for being productive. Responding quickly to mails from your boss is probably more effective than focused coding. So don't worry that much.
For the occasional productivity burst: schedule yourself a fake meeting, pick a lonesome place and your laptop, disconnect from instant messengers etc.
This is a great point. In most larger office settings, you are expected to wear many hats and respond quickly to issues that arise throughout the day.
When I need to really focus on something, I leave my cubicle and sneak away with a laptop to an empty conference room. This is the only way for me to work uninterrupted.
Bingo. The problem of office interruptions reduces down to priorities and having a boss that understands your work.
Interruptions don't have to be inevitable - there is almost always something you can do to cut yourself off. For me, I could book myself solo into a conference room for 90 minutes, block the time on my calendar, turn off my IM and mail toast, put earphones in and work.
If the concern is that you can't do this - that you'll get in trouble or won't be meeting expectations - either your priorities are out of order relative to what your boss/organization thinks they should be, or your boss/organization isn't convinced that cutting yourself off to do solitary work adds any value. One could argue that a really good boss would understand it already, but we don't always get really good bosses - if your boss isn't already convinced and you don't want to do the work to convince them, I suppose the answer is to either put up with it or leave.
I have a specific ritual for getting into the zone and one for getting out of the zone. My ritual for getting into a focused state is something like:
Move back from the computer, touch my index fingers to my thumbs, close my eyes, count down from 10, and say out loud (or write) "I am now working on (project)". It takes ~30 seconds and it works pretty well for me.
I go through the mental process of telling myself what I am working on now, but I like the idea of adding a physical ritual to go along with it. I'll try it! Thank you for sharing.
What is your ritual for getting out of the zone, out of curiosity?
I have a similar (but longer) way of getting into the zone and obviously my own way of getting out of it. However, none of it is about what you actually do. It's about the "ritual", the only time you do it is in preparation for the work and after enough repetitions it snaps you straight in. For snapping out, any time I spend a significant (or feels like it) amount of time trying to solve an issue and can't, I save everything, hit compile and get up from my desk. I prefer to step outside, relax for like 10-15 minutes not doing anything work related except maybe chatting about work with folks, and then go back. Getting up, away from the computer and letting the brain relax is what I consider the most important part. Sitting in the same place where you had the problem never let me relax enough to get through it without lots of effort/time. Getting away from it, up out of the weeds and when I sit down next time the problem becomes trivial.
This is the first news story I have bookmarked, ever. Mainly because I got distracted and started reading Mashable.
Jokes aside, I thought I had a form of ADHD with how much distractions distracted me. It's quite comforting to know other people operate this way.
I have recently, as kind of a new years resolution, aimed to be more productive. I have found myself managing my project management list more efficiently and using my "priority" status on my tasks. When I get in, in the morning, I just work top down on my priority list.
My main issue was down to not knowing fully what my next task was so I would spend time finding the task that needs sorting. I have found that the extra 15 mins a day I spend updating my task list has saved hours per week.
This has also helped when you get to the end of projects and you get the small tasks that can take hours to sort when there is no clear defined list.
I'm a task completion junkie, I feel good when I mark a task 100% and the changes I have made so far this year have fuelled my addiction.
Hehe, wish I read your comment before posting mine. But I tried this path (after seeing Randy Pausch's talk on time management) and soon discovered it was hurting my brain to decide how should I assign the correct priority value to a task. How do I decide if this homework should be assigned 4 or 5 and the other 6 - Should I try to just make it a function of time due and difficulty(?) or Should I write a naive bayes classifier that'll look into the words and assign the for me (obviously based on some training from my daily input). Then I got started hacking scripts to manage it, realized I wanted to access them through my phone so that I can update it from anywhere.. ok since this is just text based, I'll keep ssh open in my router (umm, yeah its a security issues) ... but I also need to integrate it up with google calendar and task list ...
> I thought I had a form of ADHD with how much distractions distracted me. It's quite comforting to know other people operate this way.
It's not just that "other people operate this way" -- this is in part a side-effect of the increasingly powerful behavior techniques that are conditioning people to behave this way (see Stanford's "Behavior Design" http://news.ycombinator.com/item?id=3454469).
Aren't we all distraction junkies in some way or other?
Haven't we immersed ourselves in hedonism so deep, that we can't make out noise from signal?
Every little part of our lives, is given to so many instant gratifications.
We have become information gluttons and unfortunately we don't even seem to realize it.
I would add to this a way to keep on coding while compiling. Sometimes I read the code, which does give a coding break since I am taking input and not producing output. However, at the same time I might discover errors, figure out better ways of coding something, and learn or remember how to software I wrote works.
I think I just mostly try go with the flow. Often I don't succeed in that but sometimes I do and it feels good.
Give me an interesting task that has few dependencies to others and you're going to have a hard time removing me from the computer. Give me a loose task that requires a lot of waiting and you're going to have a hard time removing me from HN or from other interests.
If I try to be highly productive all the time, I just fail myself and get depressed. Since that doesn't work I try to optimize my workflow by working on things that benefit from the idle lulls. Tasks that last days or weeks are most suitable: there might be a lot of "idling" but when I get to writing code I can bang 16 hours straight and accomplish in a day what would otherwise have taken ten days.
Conversely, doing a lot of communication-bound work will soon make me feel busy and exhausted. I'll be waiting or polling something all the time, and what's worse, I can't start anything I think is real work because I have to maintain the stack of pending tasks all the time so I know how to unwind when they finish one by one. If I dive into something then it'll take even more time for me to figure out what to do when I next hit the event loop again.
I try to teach myself that even little work is enough: working like I would love to work, the artist's way of work, is pretty much impossible in a business environment. If I'm confident I've done enough eventhough it's nothing compared to a weekend roll with a hobby project, then I don't feel so bad about getting "nothing" done. And when I get done a lot, I try to enjoy it as a precious window of time rather than the minimal bar I should reach in the following weeks.
I don't think this article offers anything to solve the problem. I believe most of the people can identify the problem. Yeah you check your mail or facebook while you're working and it causes productivity loss. But just being aware of it doesn't solve the problem. It's like when people try to lose weight they know they have to eat healthy or less but just knowing that again doesn't make them easily lose weight. Because just like losing weight, the problem about productivity isn't about knowing what to do or what not to do. Everybody knows what to do, it's simple, no distractions = better work. Real problem is avoiding that one quick facebook check every day and every hour.
IMHO this also as a lot to do with setting an appropriate work environment. On a desktop designed for work you should only have links and bookmarks related to your work. A bookmark to Facebook is a constant reminder that there might be something new on Facebook, and it's sole effect is to distract you.
I also noticed that having an appropriate background music is important. In my case I like to listen to Progressive Trance music (mostly ETN.FM Channel 2), and I have hundreds of recorded shows of 1 or 2 hours each. The goal here is to maintain a rhythm : keep going as the music goes on. I never listen to this music when I'm not working, so I ended up naturally associating it with work.
Every time a music show ends, I take a few seconds to look back on what I did during the last hour : did I complete my task ? Do I need a break ? If I feel stuck or tired I stop the music, switch environment to browse Facebook/Mail/HN/whatever, then come back 20 or 30 minutes later. Then I start by "reloading my context", reminding what I was doing and what problems I needed to solve, having a look on my TODO list (paper), and when I feel ready I start the music again and begin coding.
My personal habit is to play with a small deck of business cards, or sometimes a koosh ball with thin filaments. Both provide a pleasing tactile sensation and are easy enough to mess around with while thinking.
I also find it helpful to use this downtime to review how I've been working. The best thing I learned from the Pragmatic Programmer was to review my coding techniques and patterns, and see where there could be an improvement. Perhaps I spent the last 20 minutes fixing the wrong problem, or perhaps I didn't use a design pattern that would've made my code cleaner and easier to understand. Micro-breaks are a great time for these reviews because the code is fresh in your mind, whereas a retrospective when a release is done requires a lot more looking back.
I have to agree with the author of the post. I had the habit of checking my personal email, read BBC to see it the world was not in war and checking HN while the project I was working was building (I thought it was no big deal http://xkcd.com/303/). The big deal is that it affected my productivity. Period. When the program finished building or it aborted in the middle of the process of building, I was still thinking about something I read. It always took me some minutes before I was ready again to continue where I was.
Since the project I'm working can have long periods of building time (~up to 40minutes), I've started several projects while waiting for the program to build. Since they are all related to coding, I feel that I can swith taks much easily than reading news/checking email. And I believe I'll become a better programmer because of that (also because the projects I've started are tools to help me to perform my work).
I think I'm a distraction-junkie, I'm using Tomatoes[1], a tool to measure coding slots with pomodoros. It works great, but when I'm compiling my code, in my case running tests because I work on web applications, I can't resist to check email. I'll try useful tips from the article like reading while waiting for long tasks.
I am the distraction junkie type but in a good way i guess. Loud music nd distractions (both online and offline) are the main drivers of my workflow. I find that if i have some kind of a mental feeling (out of the computer context) to push me through that code problem which won't solve, i can work alot faster and efficiently. For example i dont have a smartphone right now but i can get one if i finish my current gig then i really think about smartphone in my free time. It keeps the furnace hot :)
+1 for the breakdancing horse! I found I tend to be distracted more easily when I'm working on something that is repetetive or isn't really challenging. When I'm working on a serious bug and trying to solve some problem, I don't have any problem getting into 'the zone'.
Its interesting that in Sweden they have workplace laws actually requiring that anyone working at a computer screen gets 10 minutes of rest (away from the screen) every hour.
I switch between the two modes this article describes quite regularly.
Reflecting on it other things cause me to go into distraction mode are:
- Not sufficiently planning out boring changes (That's easy! Get stuck as I realise I've done it wrong. 1 hour later, oh, I'm reading HN, how did that happen?)
- Having to write large, but simple objects or CRUD code
- A change or bug that requires picking apart poorly written code. Refactoring helps me stay focused but that often feels like procrastination.
- Using a library I don't know well but is documented poorly
- Trying to get OAuth authentication working (every single bloody time, I hate it)
- Having to modify any existing javascript even if I wrote it, I find js so hard to re-parse. function, function, function, function, function, function. I can't pick out the flow of the code. One of the reasons I've never got on with Lisp either I think.
Not necessarily. It can take a long time to load a large project, including any Rails applications. A typical Rails application can take about 30 seconds to load (that's any time you run a Rake task, launch a server, run unit tests, etc) and unit test runs can typically take a few minutes, often times more than 10 minutes for large applications. If you use a test server, such as Spork, the load time largely goes away for running your tests, but there's still a few seconds of startup time. Just because a language doesn't have an explicit "compile" step doesn't mean its void of compiling-related problems.
The last article I read before going to sleep was http://en.wikipedia.org/wiki/Attention_deficit_hyperactivity... - feeling disgusted that surely I'm that unfortunate guy, who was not diagnosed early and carried this into my adulthood.
But that this article sits on top of HN, makes me feel better - I'm not alone with (speed_of_inspirational_input > speed_of_implemented_idea).
My question is be it pomodoro or this bigger focused chunk - I've always struggled at the boundaries. Say you are not done at the end of the stipulated time for focused work - there's this one liner fix that'll only take a second - and that blows it. Ever fell into that trap?
I struggle with the boundaries as well. Especially at the end of the day or before lunch. "This will only take me 1 minute" fixes turn into half-hours and ruin the whole schedule.
One thing that might be worth trying is to just stop working whenever your time chunk is done, regardless of what's left. I remember reading an article here on how Hemingway used to stop writing in the middle of a sentence at the end of a creative writing session. The author was suggesting that programmers do the same thing (leaving a half completed function or even line of code, even if it means that the project isn't building).
I tried it after reading the article and I was very surprised with the results. I find it much easier to start in the morning when I have a half completed line of code in front of me. The context comes back almost instantaneously and even when it only takes me a minute to finish what I had started the day before, I feel like I am already in the flow and I will be much quicker when I start the next task. When the first task on my list is to start a feature for example, I often end up browsing the code files aimlessly trying to find the starting point, etc.
Ever since I started using this technique, I find it much easier to just stop at the end of an allocated time chunk. It's only a question a perception obviously, but instead of feeling like I have given up on a task before it was done, I think of it as a way to set myself up for the next time chunk.
Great article. BTW does somebody here know great timer app for Mac or Linux? I'm trying this "60 work / 30 rest" pattern, but sometimes problem is so interesting and I just can't keep track of the time:)
68 comments
[ 3.2 ms ] story [ 154 ms ] threadIt's certainly easier to do something after having read about it. But how much can you really do, and how much of it is truly relevant to your goals? You can't help but feel that not tapping into powerful tools like RSS feeds is damaging in some way. Intangible as it is.
It's the same thing my yoga teacher told me - when you do anything - you have to focus as hard as possible, as long as possible. Then re-focus to other thing and never float like a leaf on pond - this won't get you anywhere.
What if the task you just put into background kept working on it's own?
I think humans were built to multitask, our environment is too complex to be single threaded, think driving: you need o pay attention to multiply things at the same time.
The brain has billions of cores on parallel units, but they are unconscious.
"Would you still force it to use one core?"
No, you can't use only one at all, but you use "the one",the conscious brain(that could only do one thing at the same time) to coordinate them all, you should "force" the millions of cores to work in the same thing at the same time.
"I think humans were built to multitask, our environment is too complex to be single threaded, think driving: you need o pay attention to multiply things at the same time."
They were built to multi task over the same thing. If you go hunting but you are also thinking on your girlfriend while you remember the taste of the food you ate yesterday and try your nephew does not get hurt you won't be as efficient as someone that focus all their senses and thoughts over one single task.
However, software development calls for a very different kind of mental work, one we couldn't have evolved to be good at since our species only started doing it very recently: juggling multiple levels of abstractions in your head along with countless low-level details. That's so hard to do that trying to do it concurrently with other tasks severely degrades our ability to do it. Paul Graham wrote about this very eloquently in his essay "Holding a Program in One's Head" (http://paulgraham.com/head.html).
If I have such free time, there is always something else work-related for me to do, since I am not tasked with only coding. - Go over the code I have just written.
- It is time to commit, so look at diffs and commit.
- Check the server's performance.
- Go over list of pivotal stories and see what I be doing next.
- Take a break, go for a walk around in the building, check out the beautiful view.
- Go over calendar and see if there is anything I need to not-forget.
- Read something related to programming, a book at work or an article.
- Have a talk with fellow co-workers about something that has been on your mind.
This might be usable advice for someone who works at home on his own business, but for those of us who work in office environments, there are sources of distraction that are much more difficult to control than the urge to read news: meetings, your boss walking into your office, colleagues who interrupt you with urgent requests for help, etc. (If you're a developer who also manages a team, multiply this by ten.) The only time I can get an hour of uninterrupted work is after everyone goes home. So I think a more useful question is: how can you get back into a productive state more quickly after the inevitable interruption occurs?
Or, to go back to Zen: how can you lose the attachment you have to the flow of uninterrupted work? When it happens, it feels really good, but when it doesn't happen, it would be better not to get too frustrated about it and be able to move on.
That said, I thought the article's advice to consciously choose stretching or brief meditation over e-mail or news to be something worth trying.
For the occasional productivity burst: schedule yourself a fake meeting, pick a lonesome place and your laptop, disconnect from instant messengers etc.
When I need to really focus on something, I leave my cubicle and sneak away with a laptop to an empty conference room. This is the only way for me to work uninterrupted.
Interruptions don't have to be inevitable - there is almost always something you can do to cut yourself off. For me, I could book myself solo into a conference room for 90 minutes, block the time on my calendar, turn off my IM and mail toast, put earphones in and work.
If the concern is that you can't do this - that you'll get in trouble or won't be meeting expectations - either your priorities are out of order relative to what your boss/organization thinks they should be, or your boss/organization isn't convinced that cutting yourself off to do solitary work adds any value. One could argue that a really good boss would understand it already, but we don't always get really good bosses - if your boss isn't already convinced and you don't want to do the work to convince them, I suppose the answer is to either put up with it or leave.
Move back from the computer, touch my index fingers to my thumbs, close my eyes, count down from 10, and say out loud (or write) "I am now working on (project)". It takes ~30 seconds and it works pretty well for me.
What is your ritual for getting out of the zone, out of curiosity?
Jokes aside, I thought I had a form of ADHD with how much distractions distracted me. It's quite comforting to know other people operate this way.
I have recently, as kind of a new years resolution, aimed to be more productive. I have found myself managing my project management list more efficiently and using my "priority" status on my tasks. When I get in, in the morning, I just work top down on my priority list.
My main issue was down to not knowing fully what my next task was so I would spend time finding the task that needs sorting. I have found that the extra 15 mins a day I spend updating my task list has saved hours per week.
This has also helped when you get to the end of projects and you get the small tasks that can take hours to sort when there is no clear defined list.
I'm a task completion junkie, I feel good when I mark a task 100% and the changes I have made so far this year have fuelled my addiction.
EPIC fail. This year only laundry lists in phone.
It's not just that "other people operate this way" -- this is in part a side-effect of the increasingly powerful behavior techniques that are conditioning people to behave this way (see Stanford's "Behavior Design" http://news.ycombinator.com/item?id=3454469).
Give me an interesting task that has few dependencies to others and you're going to have a hard time removing me from the computer. Give me a loose task that requires a lot of waiting and you're going to have a hard time removing me from HN or from other interests.
If I try to be highly productive all the time, I just fail myself and get depressed. Since that doesn't work I try to optimize my workflow by working on things that benefit from the idle lulls. Tasks that last days or weeks are most suitable: there might be a lot of "idling" but when I get to writing code I can bang 16 hours straight and accomplish in a day what would otherwise have taken ten days.
Conversely, doing a lot of communication-bound work will soon make me feel busy and exhausted. I'll be waiting or polling something all the time, and what's worse, I can't start anything I think is real work because I have to maintain the stack of pending tasks all the time so I know how to unwind when they finish one by one. If I dive into something then it'll take even more time for me to figure out what to do when I next hit the event loop again.
I try to teach myself that even little work is enough: working like I would love to work, the artist's way of work, is pretty much impossible in a business environment. If I'm confident I've done enough eventhough it's nothing compared to a weekend roll with a hobby project, then I don't feel so bad about getting "nothing" done. And when I get done a lot, I try to enjoy it as a precious window of time rather than the minimal bar I should reach in the following weeks.
I think I can reliably derive my focus from the traffic between my machine and HN.
I also noticed that having an appropriate background music is important. In my case I like to listen to Progressive Trance music (mostly ETN.FM Channel 2), and I have hundreds of recorded shows of 1 or 2 hours each. The goal here is to maintain a rhythm : keep going as the music goes on. I never listen to this music when I'm not working, so I ended up naturally associating it with work.
Every time a music show ends, I take a few seconds to look back on what I did during the last hour : did I complete my task ? Do I need a break ? If I feel stuck or tired I stop the music, switch environment to browse Facebook/Mail/HN/whatever, then come back 20 or 30 minutes later. Then I start by "reloading my context", reminding what I was doing and what problems I needed to solve, having a look on my TODO list (paper), and when I feel ready I start the music again and begin coding.
I also find it helpful to use this downtime to review how I've been working. The best thing I learned from the Pragmatic Programmer was to review my coding techniques and patterns, and see where there could be an improvement. Perhaps I spent the last 20 minutes fixing the wrong problem, or perhaps I didn't use a design pattern that would've made my code cleaner and easier to understand. Micro-breaks are a great time for these reviews because the code is fresh in your mind, whereas a retrospective when a release is done requires a lot more looking back.
Since the project I'm working can have long periods of building time (~up to 40minutes), I've started several projects while waiting for the program to build. Since they are all related to coding, I feel that I can swith taks much easily than reading news/checking email. And I believe I'll become a better programmer because of that (also because the projects I've started are tools to help me to perform my work).
[1] http://tomatoes.heroku.com
Fortunately I do PHP and do not need to compile ;)
Its interesting that in Sweden they have workplace laws actually requiring that anyone working at a computer screen gets 10 minutes of rest (away from the screen) every hour.
http://stackoverflow.com/questions/2976630/why-does-go-compi...
I switch between the two modes this article describes quite regularly.
Reflecting on it other things cause me to go into distraction mode are:
- Not sufficiently planning out boring changes (That's easy! Get stuck as I realise I've done it wrong. 1 hour later, oh, I'm reading HN, how did that happen?)
- Having to write large, but simple objects or CRUD code
- A change or bug that requires picking apart poorly written code. Refactoring helps me stay focused but that often feels like procrastination.
- Using a library I don't know well but is documented poorly
- Trying to get OAuth authentication working (every single bloody time, I hate it)
- Having to modify any existing javascript even if I wrote it, I find js so hard to re-parse. function, function, function, function, function, function. I can't pick out the flow of the code. One of the reasons I've never got on with Lisp either I think.
Typical? Wtf kind of codebases have you been working on?
The largest Rails app I've worked on had 250 models and 200 controllers. It took 12 seconds to load the Rails environment on Ruby 1.8.
Rails 3.1+ on 1.9.3 is pretty darn fast, even for medium-sized apps (50+ models).
My question is be it pomodoro or this bigger focused chunk - I've always struggled at the boundaries. Say you are not done at the end of the stipulated time for focused work - there's this one liner fix that'll only take a second - and that blows it. Ever fell into that trap?
One thing that might be worth trying is to just stop working whenever your time chunk is done, regardless of what's left. I remember reading an article here on how Hemingway used to stop writing in the middle of a sentence at the end of a creative writing session. The author was suggesting that programmers do the same thing (leaving a half completed function or even line of code, even if it means that the project isn't building).
I tried it after reading the article and I was very surprised with the results. I find it much easier to start in the morning when I have a half completed line of code in front of me. The context comes back almost instantaneously and even when it only takes me a minute to finish what I had started the day before, I feel like I am already in the flow and I will be much quicker when I start the next task. When the first task on my list is to start a feature for example, I often end up browsing the code files aimlessly trying to find the starting point, etc.
Ever since I started using this technique, I find it much easier to just stop at the end of an allocated time chunk. It's only a question a perception obviously, but instead of feeling like I have given up on a task before it was done, I think of it as a way to set myself up for the next time chunk.
sleep 30min ; mplayer xxx.mp3
Don't need any ticking timer, it will just distract you. But if you really need it's only a few more lines.
I used to do sleep 60 min ; find / to wait for the hard disk noise but that doesn't work anymore since i have a SSD.
and if you're honest with yourself, it gives a useful measure at the end of the day of how much time was spent on uninterrupted work.