Sleeping 😴

Simple and obvious, but true ... engineering takes an alert mind.

It's very easy, very seductive, to throw a lot of consecutive hours at a problem. One can get into a 'flow' state where one's mind becomes filled with the problem, and the work just pours out, hour after hour. Many writers report that they watch a story take place, and just transcribe what they see, pounding out page after page of text. Many software engineers have experienced a similar feeling, where the code appears to arise spontaneously as they watch themselves type.

I believe most real work gets done in this state.

My experience, however, is that the 'flow' period can end subtly and gradually. Without ever noticing a change, I notice that new work isn't flowing out of my hands anymore, that I'm spending lots of time fixing up mistakes I made just a few moments ago. Instead of ideas flashing confidently through my mind, doubts and questions arise.

At this point there is a temptation to throw some more hours at the problem. 'I'm here, and I was getting a lot of work done, why don't I just stay all night until I figure this out?' This is a trap! Don't do it!

Instead, I suggest: go home, eat, shower, sleep, put yourself back together again. Resume the next day. While you sleep, your mind will work on the problem anyways, and you'll probably wake up with new ideas. You'll get more done between 10:00 am and 2:00 pm the next day, than if you stayed up between midnight and 10:00 am.

There is a problem with this strategy: remotivating yourself in the morning. If the project is one of your choice, that's usually not a problem. If it's something you have to do but don't enjoy, you have to balance the remotivation problem versus the very low productivity of working without sleep.