Chad Perrin: SOB

11 March 2008

insomnia and productivity

My insomniac productivity a few days ago wasn't just geared toward writing lengthy rambles about the differences between various forms of philosophical libertarianism. I also wrote code — in particular, I wrote an entire program from start to finish, inspired by code I found online for doing the same thing that (frankly speaking) sucked.

I wonder why it was such a productive night. As I think about it, I remember that my experience in years past mirrors the stereotype: geeks that stay up all night hacking away at something that totally consumes their attention at the time, producing far more in a couple nights' work than your average professional does in a month.

The phenomenon has been termed hack mode:

a Zen-like state of total focus on The Problem that may be achieved when one is hacking (this is why every good hacker is part mystic)

More about it, from the same source:

Being yanked out of hack mode (see priority interrupt) may be experienced as a physical shock, and the sensation of being in hack mode is more than a little habituating. The intensity of this experience is probably by itself sufficient explanation for the existence of hackers, and explains why many resist being promoted out of positions where they can code.

Recently, Sterling "Chip" Camden (of Chip's Quips and Chip's Tips) recently wrote on the subject of geek productivity. It was cast as consultant productivity, of course, because that's the sort of geek he is — but it gets into the same concepts as the Jargon File definition of "hack mode".

Compare his words:

Focus. One reason why IT pros don’t always do so well in social situations is that they have the power to concentrate intently on one problem to the exclusion of everything else. (No, honey, I wasn’t ignoring you — I actually didn’t hear you, even though you were standing right beside me and speaking clearly. I might have even said “uh huh,” but that was just a 202 response.) We geeks need to maximize this ability in order to be effective. We can’t allow ourselves to be interrupted for “just a minute” to answer a question. The instant we break concentration, the entire problem that we were modeling in our head drops on the floor and shatters into a million pieces. This is why you shouldn’t answer the phone, e-mail, or chat during these periods.

. . . with these from the "hack mode" entry at the Jargon Wiki:

Some aspects of hacker etiquette will appear quite odd to an observer unaware of the high value placed on hack mode. For example, if someone appears at your door, it is perfectly okay to hold up a hand (without turning one's eyes away from the screen) to avoid being interrupted. One may read, type, and interact with the computer for quite some time before further acknowledging the other's presence (of course, he or she is reciprocally free to leave without a word). The understanding is that you might be in hack mode with a lot of delicate state (sense 2) in your head, and you dare not swap that context out until you have reached a good point to pause.

Crazy-late hours of intensive hacking lend themselves naturally to entering, and sustaining, a deep state of "hack mode":

  • Other (saner) people aren't around to interrupt. They're all asleep. This provides additional safety when juggling eggs.
  • The requirement of keeping from disturbing others inhibits the tendency to engage in distracting entertainments (like TV). This almost forces one to focus entirely on one's work. Only something like reddit stands in the way.
  • Subjectively speaking, it seems that the wee hours of the morning lend themselves to an almost surreal, abnormal perspective. Inspiration can be found in odd places under that sort of influence — which leads to new ideas coming to mind and being explored that, by the light of day, may have been dismissed immediately as "crazy talk".

Discovery of these benefits to late nights coupled with the heady experience of "hack mode" itself (it's like a powerful psychologically addictive drug — really and truly), along with other factors, surely contributes to the increasingly nocturnal and insomniac (sometimes to self destructive extremes) tendencies common in "larval stage":

a period of monomaniacal concentration on coding apparently passed through by all fledgling hackers. Common symptoms include the perpetration of more than one 36-hour hacking run in a given week; neglect of all other activities including usual basics like food, sleep, and personal hygiene; and a chronic case of advanced bleary-eye. Can last from 6 months to 2 years, the apparent median being around 18 months. A few so afflicted never resume a more `normal' life, but the ordeal seems to be necessary to produce really wizardly (as opposed to merely competent) programmers.

This makes a lot of sense, considering the fact it generally takes ten years to become a competent programmer. The same is essentially true of anything — it takes ten years' worth of work to become truly proficient (what the unambitious might call a "master") in any skill that embodies great technical challenges. It's not the actual chronological period of ten years that matters, of course — it's the amount of time and effort invested in learning and practicing the skill that matters. It just observably tends to take about ten years for most people who consistently pursue such skills to reach a level of significant proficiency.

I'm prone to insomnia — it comes and goes, sometimes afflicting me for a week at a time, occasionally longer, sometimes only one night here and there. I try more and more all the time to adopt a more "normal" sleep schedule, but I'm simply not nearly as effective at this as I'd like. The insomnia keeps coming — and the definition of larval stage holds a clue to one of the reasons for it:

A less protracted and intense version of larval stage (typically lasting about a month) may recur when one is learning a new OS or programming language.

This obviously isn't the sole reason for my bouts with insomnia, or even the primary reason. It is, however, probably a contributing factor.

I don't think I have a perfect handle on the forces at work, however — even those in my own head. The above-listed benefits can't be the only reason that, when I allow it, insomnia can be so productive, for instance. It'll bear more thought.

By the way, the program I wrote was a command-line utility that retrieves currency exchange rate data from the Internet and provides up-to-date translations between currencies. It was inspired by the train wreck of a currency exchange utility I found here. As of this writing, that program I found is hopelessly broken, in addition to being poorly written and essentially unmaintainable — thus my desire to write something better.

24 Comments

  1. I love you, man. (:

    Comment by Joseph A. Nagy, Jr. — 11 March 2008 @ 04:48

  2. Thanks! It's always good to see you online — even when you aren't expressing your appreciation for my mild brand of craziness.

    Comment by apotheon — 12 March 2008 @ 09:36

  3. [...] Chad Perrin: SOB » insomnia and productivity Isn’t everyone like that? (tags: programming hacking zone insomnia) [...]

    Pingback by links for 2008-03-13 -- Chip’s Quips — 13 March 2008 @ 01:24

  4. Wow. At first I thought this was crazy, but then I started to realize sometimes I do the same thing. Generally, I don't get too into my programs. I listen to music, browse the web every so often. In general, I don't ever seem to accomplish much. Then, at some point, I'll get locked on. Nothing else goes on but me and programming. I'm usually pretty amazed how quickly I'll solve something after that point. It drives me nuts if the phone rings or something. That is kinda strange. Personally, I'm guessing it's some kind of trance or mild hypnosis. Kind of like when an athlete is "in the zone."

    Comment by Brandon — 13 March 2008 @ 10:53

  5. There are some definite similarities between what the Jargon File calls "hack mode" and what athletes call "the zone". I've experienced both, and while they're not identical, they do seem to be related.

    Comment by apotheon — 13 March 2008 @ 03:31

  6. [...] [CODE] insomnia and productivity, sob.apotheon.org [...]

    Pingback by Delicious Links - 20 links - tools, gamers, workhacks, code, links « // Internet Duct Tape — 16 March 2008 @ 12:45

  7. "Flow is the mental state of operation in which the person is fully immersed in what he or she is doing, characterized by a feeling of energized focus, full involvement, and success in the process of the activity. Proposed by psychologist Mihály Csíkszentmihályi, the concept has been widely referenced across a variety of fields."

    http://en.wikipedia.org/wiki/Flow_(psychology)

    Comment by teknik/kultur — 18 March 2008 @ 12:18

  8. [...] have to be awake all night, knocking something out in hack mode seems like the best way to do it. Insomnia and productivity [Chad Perrin via Internet Duct [...]

    Pingback by Turn Insomnia into a Productivity Boost [Sleep] » Lifehacker, tips and downloads for getting things done — 18 March 2008 @ 12:23

  9. This is a breath of morning air to an "audiohacker" such as myself. Zen states are definately achieved in those hours of solitude. I just wish more people would attempt it and experience before laying judgement. Thank you.

    Comment by theshinjukueffect — 18 March 2008 @ 03:11

  10. [...] in years past mirrors the stereotype: geeks that stay up all night hacking away at something that totally consumes their attention at the time, producing far more in a couple nights' work than your average professional does in a [...]

    Pingback by Devolio — 18 March 2008 @ 04:13

  11. I know the feeling all too well, a project completely sucks you in for hours and you can't stop working on it. Great read, thanks.

    Comment by Joey — 18 March 2008 @ 04:15

  12. I suffered from Hypomania for about 3 years, at the tail end of my 10 years of experience. I started at 18, and I just turned 29. I always had regular bouts of productivity like you talked about, then I went sort of numb for a few years. Then for the last few years before I discovered I was manic depressive, I would have extreme bouts of productivity(6 weeks or so straight of nothing but brilliant work, with a tinge and nonsensical work) followed by total stupidity and exhaustion for weeks and months later.

    I basically have predominantly upper moods, and few downer mood swings, mainly because I find the downs relaxing now that I'm aware of them, and realize they basically my mind needing a break from over work. Few people who are manic depressive have manageable mania like I do, most have to go on meds, where as I just need to watch my sleep and workout a lot to sleep well when it gets out of hand.

    Comment by Endergen — 18 March 2008 @ 09:18

  13. [...] stumbled across a post by Chad Perrin titled “Insomnia and Productivity”. He hits the nail on the head as to why working 15+ [...]

    Pingback by The Midnight Oil… | The Geekery — 18 March 2008 @ 09:18

  14. 36 hours... 6 months – 2 years... 'larval stage'... etc ... Welcome to the beginning.

    This 'zen-like state' is merely a key to the entrance of the abyss. The fearless one will enter this void. Such states need not be confined to monomaniacal objectives, nor restricted to coding or anything else; there are no bounds except those which are unconsciously imposed.

    It was once stated: "Man looks in the abyss, there's nothing staring back at him. At that moment, man finds his character. And that is what keeps him out of the abyss." — Lou Manheim, Wall Street

    These are a fool's words. To be expected from a Hollywood film script.

    For deeper meaning, see this man's quotes: http://www.eyeballsout.com/quotes/brucelee.html He was known to live without bounds... his path led to death at 32. Hati Hati.

    We are born unto our characters... and the abyss is our playground...

    Comment by k.os.tao — 18 March 2008 @ 10:11

  15. A generally targeted comment:

    Welcome to SOB. I'm your host, Chad. Some of you have given me things to think about with your comments here and with posts on your own weblogs that link here (see the trackbacks/pingbacks for details).

    Thanks.

    Comment by apotheon — 19 March 2008 @ 12:00

  16. [...] insomnia and productivity [sob.apotheon.org, gefunden bei Lifehacker] Hier erscheint jeden Morgen von Montag bis Freitag ein [...]

    Pingback by imgriff.com » Blog Archiv » Der Link am Morgen: Nachtarbeiter — 19 March 2008 @ 12:25

  17. Beautiful! Couldn't have been better stated!

    Comment by Anne — 19 March 2008 @ 07:39

  18. I'm not a programmer, but I definitely get more done in that overnight time when most people are asleep. It's nice to find others in this same "club"!

    Comment by Judy — 19 March 2008 @ 08:02

  19. [...] Insomnia and Productivity [...]

    Pingback by GTD: Discardia, Controlling Cravings, Insomnia, and more - Matt Heerema : Web Design — 20 March 2008 @ 07:23

  20. [...] There are nights when my insomnia kicks in. But according to this tip, you can actually use that insomnia-state to increase your productivity. [...]

    Pingback by Eternalmoonlight.net » Life tips #4 — 22 March 2008 @ 06:09

  21. [...] Chad Perrin: SOB » insomnia and productivity [...]

    Pingback by Last week links « Piku’s Blog — 23 March 2008 @ 12:04

  22. [...] [From Chad Perrin: SOB » insomnia and productivity] [...]

    Pingback by Problems I have with a 9-5 (or 7-4 as the case may be) — 27 March 2008 @ 04:08

  23. [...] to stop in Grand Junction and finish the drive the next day. That night, I suffered another bout of productive insomnia, and got some writing done. Some of it was article material for the IT Security Weblog at [...]

    Pingback by Chad Perrin: SOB » . . . I don't think so. — 2 December 2008 @ 06:32

  24. [...] comments on Joel Spolsky's statements about being in "the zone", also known as hack mode, which is of course incredibly important to programmer productivity, but I think he focuses on that [...]

    Pingback by Chad Perrin: SOB » Um, I have an answer! — 14 February 2009 @ 02:04

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

All original content Copyright Chad Perrin: Distributed under the terms of the Open Works License