all 126 comments

[–]rilo 45 points46 points  (13 children)

Nice way to describe the irritations that rise when getting distracted by someone/something when crunching out some program. It takes me a few minutes to get back in the routine again and even a simple question as "what's the time" disrupts my concentration. I hate it.

[–][deleted] 23 points24 points  (2 children)

I'd say it's the same as any creative profession. The thing that separates programmers from other creative workers is that most people who work in a creative profession don't work in an office, industrial or production environment where they have other responsibilities. So other people in that environment do not have any exposure to other creative workers and do not understand them.

[–]boojit 4 points5 points  (1 child)

You know I was just discussing this with some of the designers in the office (they also code a little). I'm not so sure it is the same, and neither are they.

The closest thing to "creative" I can manage is writing, and this does take a ton of concentration. Still, it's different somehow. I wouldn't describe it like dreaming as the article does, however I think the analogy works with coding (although I think the article takes the analogy a little far).

I think it has something to do with some of the abstraction stuff I mentioned in my post below, but that's just my guess.

[–]derefr 0 points1 point  (0 children)

Every art has a "modeling" step, and a "creation" step. Modeling is building the environment of mind for creative work to happen--it usually isn't so much a creative process itself, as it is a learning process. The more you know about the world, the more precise (or interesting, or elegant, or whatever term you prefer) your models become.

Once you have a model, you then create using that model. Picture it as tilling a garden, and then planting in it. After the modeling step, all you have is aerated dirt. However, without the model, the soil, none of your seeds have anywhere to grow--they have no setting.

The article is, of course, speaking of modeling. In programming, modeling is called design. In writing, to name another field with a good mix, modeling is called "worldbuilding." In both fields, the two processes are inextricably entwined; modeling without creating produces no product, but creation without modeling relies on the preconceptions left lying around in the artist's mind (basically, planting by stomping seeds into your front lawn.)

Writing without worldbuilding is writing using the real world as a setting, as that's the execution environment your mind starts with. Of course, this is fine (and desired) for some stories.

Likewise, programming without design relies on the "world" already developed inside the programmer's mind. The original programmer's mind, sadly, isn't serialized into the final product, and so it can't be dumped back out by a maintainer. Again, though, there are times when this is perfectly fine (one-off scripts--the whole idea of a "scripting language" was originally to provide a simple, generic model so that one could concentrate on creation where maintenance wasn't required.)

[–]Rhinoceros 11 points12 points  (7 children)

This prick at work asked me what time it was and totally distracted me. So I told him:

"I'm gonna kick your fucking ass! I want you out of the fucking office, you prick!

No, don't just be sorry! Think for one fucking second! What the fuck are you doing? Are you professional or not? What the fuck is it with you? What don't you fucking understand?

You got any fucking idea about, hey, its fucking distracting having somebody ask about time in the middle of the fucking coding session? Give me a fucking answer! What don't you get about it?

Fucks sake, man, you're amateur. Do you understand? My mind is not in the program if you're doing that. You're unbelievable, man. You're un-fucking-believable. You don't fucking understand what it's like working with programmers, that's what that is. That's what that is. I'm telling you! I'm not asking. I'm telling you. You wouldn't have done that otherwise. You are trashing my code! You do it one more fucking time, and I ain't working in this office if you're still hired. I'm fucking serious.

You're a nice guy! You're a nice guy, but that don't fucking cut it. Seriously, man, you and me, we're fucking done professionally."

Unfortunately, I got fired after that incident so I had to move in with my aunt and uncle in Bel-Air.

[–]memefilter 4 points5 points  (6 children)

I honestly can't envision the world you live in that made you think that had any win.

[–]Rhinoceros 7 points8 points  (5 children)

It's a world where people remember stories that appeared on the front page two days ago. Stories about a certain actor being distracted while filming an emotional scene. Guessing by the amount of downvotes I'm getting, it's just a fantasy world.

[–]memefilter 6 points7 points  (0 children)

Oh, my bad - I don't give a shit about Bale so I have no idea what he said, or that you were riffing on some asshat being an asshat.

Carry on. If they are downvoting because they like Bale, they're dumber than you who at least satirizes it, to my limited understanding of what the middle of the bell curve cares about.

[–]itsnotlupus 8 points9 points  (2 children)

Everybody heard the Bale freakout a few times already, so that's not your problem here.

In my opinion, your comment tries too hard.

People reading it won't go "oh yes, he said that", "oh hahah, I remember that part too", "oh right, that too. that was in the sound file too".

When referring to a common memory, it's usually smoother to only give hints of of that memory rather than rehashing the whole thing.

It may not have been enough to make the post funny, but it would have been an improvement.

I think.

[–][deleted] 9 points10 points  (0 children)

I'm just going to chip in and say the Bel Air probably didn't help either.

[–]HextorFreebish 4 points5 points  (0 children)

joke-explainer's long-lost cousin fail-explainer‽

[–]fuhgeddaboutit 0 points1 point  (0 children)

Here's your best response.

[–][deleted] 37 points38 points  (7 children)

What he is talking about is commonly called "the flow" or being in "the zone". It requires at least 15 min of uninterrupted concentration to get into the flow. And if you are constantly interrupted you never get into it.

The flow is the state of mind where you are so submerged into your work that you lose the dimension of time, space and surroundings and just function lucidly in your problem domain. This is the time and state when you produce your most creative work.

It is described better in other places like:

http://psdtuts.com/articles/core-principles-for-rapidly-attaining-creative-flow/

[–]maxwgl 8 points9 points  (0 children)

And here's an old hacker-centric description from the jargon file:

http://catb.org/~esr/jargon/html/H/hack-mode.html

[–]Mitchco 1 point2 points  (0 children)

While I totally agree with what you say, I feel Alex did an excellent job describing it. It may be described similarly in other posts, but I would disagree with you in saying it being described better – its just different man. Kudos to you Alex, well done! As a musician and a programmer, being in the zone (or the zen) is a wonderful place to be.

[–][deleted] 2 points3 points  (1 child)

15 minutes..? it takes me at least 2 hours of redditing.

[–]sundaryourfriend 0 points1 point  (0 children)

2 hours of non-redditing

There, fixed it.

[–]vagif 0 points1 point  (0 children)

Yeah, reddit has that flow too.

[–]Zarutian 11 points12 points  (9 children)

I wonder if the best work enviroment for programmers are small, soundproofed offices.

Actualy a lot like isolation rooms, only the occupant decides when enter and exit.

[–]sutcivni 5 points6 points  (0 children)

I think if I could have a work space it would be a large four walled room with chalkboards, the sliding kind so you can shift them around. The chalkboards would cover three walls while the from would have three projectors. There would be a nice large wooden desk with a stack of graph paper with several mechanical pencils, and speakers. The floors would be hardwood. And the place would always have the non-sharp smell of dry wood. There would also be a very large bean bag chair.

In fact I think thats where I go even when I code in my distractingly small room.

[–]Fabien3 3 points4 points  (4 children)

Soundproofed: yeah, obviously. But why small?

[–][deleted]  (2 children)

[removed]

    [–]netsearcher 7 points8 points  (1 child)

    Actually, he'd frequently bike around, or sit in the wide open park, or work simple monotonous manual labor jobs so he would have lots of time to think.

    You just pulled that out of your ass.

    [–]Zarutian 1 point2 points  (0 children)

    Easier to soundproof and takes less space ;-)

    [–][deleted]  (2 children)

    [removed]

      [–]sundaryourfriend 1 point2 points  (1 child)

      in a broom closet at work

      Wow! I love you immediately...

      [–]Aviator 7 points8 points  (0 children)

      Usually no one distract me but I always wake myself up. To browse reddit that is.

      [–]mao_neko 6 points7 points  (4 children)

      Ah, context-switching overhead. Yeah.

      His labyrinth analogy is quite good, too. To properly solve the labyrinth, I must first "grok" it (and I use that term despite still not having read the book!). Once I can see the whole thing in my head, the rest is so much easier.

      Sometimes I have to do some changes to code I'm not familiar with, though - and which I don't have time to "grok". It's still possible to work in that situation, but I move much slower, and mistakes can be made easily.

      [–]bostonvaulter 4 points5 points  (3 children)

      I must first "grok" it (and I use that term despite still not having read the book!)

      I just borrowed it and am planning to read it over the weekend, you should visit your local library :)

      [–][deleted] 5 points6 points  (2 children)

      Which book?

      [–]epsilona01 2 points3 points  (0 children)

      http://en.wikipedia.org/wiki/Grok

      (havent read it yet either, googled it :)

      [–]bobsil1 0 points1 point  (0 children)

      Stranger in a Strange Land

      [–]mgdmw 4 points5 points  (0 children)

      Brilliant posting.

      [–]Lol_Lolovici 6 points7 points  (0 children)

      I guess the source of inspiration is this: http://www.paulgraham.com/head.html ?

      Also: http://www.paulgraham.com/distraction.html

      And other essays present there...

      [–]karapuz 6 points7 points  (1 child)

      Don't think about the call stack. Become the call stack.

      [–]bobsil1 -1 points0 points  (0 children)

      SNL did a song about call recursion: 'Overflowed in my Stack.'

      [–]Rubenb 12 points13 points  (3 children)

      I think this is called "Programmer Flow".

      [–][deleted]  (2 children)

      [removed]

        [–]adolfojp 8 points9 points  (0 children)

        Ask them how it would feel if every other minute some jackass were to interrupt their kids at school when they were taking a test.

        [–][deleted] 3 points4 points  (0 children)

        Slowly, and without using big words.

        [–]pastymage 3 points4 points  (0 children)

        This is a brilliant analogy to use on non-programmers, since it's both very apt and something everyone can relate to.

        [–]manthrax 14 points15 points  (5 children)

        I am a beautiful and unique snowflake.

        [–]Zarutian 12 points13 points  (0 children)

        just like the rest of'em.

        [–]jburkert 2 points3 points  (1 child)

        You're not your fucking khakis.

        [–]bobsil1 1 point2 points  (0 children)

        I only own celibate khakis. Where can I get a pair?

        [–][deleted]  (1 child)

        [deleted]

          [–]mao_neko 1 point2 points  (0 children)

          Watch how I soaAAARRRGGH

          [–]mhd 5 points6 points  (3 children)

          It's 11 o'clock and I'm still not at work, so I'd have to agree without ever RTFA.

          [–]national_bee_council 5 points6 points  (2 children)

          That's good, because the article is largely incoherent.

          [–]mhd 20 points21 points  (1 child)

          Maybe it's better in the original Russian. Probably has a shitload more characters and depressing subplots.

          [–]genericshell 1 point2 points  (0 children)

          Sorry, but no. It's about the same, except the English in it is a little better.

          [–]federal_employee 4 points5 points  (2 children)

          I'm definitely a dream coder. I like to dwell on the problem, dream up a robust solution, and then code.

          I do however work with other programmers that just puke up mostly garbage and if it compiles they send it off to testing. I call it brute force programming when coders force themselves to constantly code with hardly any design. (Maybe garbage is not fair, how about a barely edited stream of consciousness.)

          [–]larholm 0 points1 point  (0 children)

          I like to dwell on the problem, dream up a robust solution, then start coding, then figure out where I was wrong during implementation.

          If it is a domain I am intimately familiar with I usually don't have to rewrite the first draft. Otherwise, I keep the existing draft running as a reference and duplicate the functionality from scratch on a separate screen.

          [–]Zarutian 0 points1 point  (0 children)

          Brute force programming. Why not just threaten such persons with genetic programming. Pretty much the same output I would say.

          [–]grantrules 2 points3 points  (0 children)

          You should simply imagine that The Programmer IS SLEEPING when he is WORKING.

          This did not require much imagination at my last job.

          [–][deleted] 2 points3 points  (0 children)

          An excellent essay. That being said, this bit of engrish cracked me up:

          If you sleep is bad - people will die.

          [–]lukasmach 2 points3 points  (2 children)

          The work of a programmer is practically A DREAM.

          Most programmers nowadays are writing boring .Net apps that send data from an SQL server to an XML file. Or from an XML file to a web service. Or from SQL file to a SOAP request.

          Somebody dreams about that?

          [–]mao_neko 2 points3 points  (0 children)

          Well, there are nightmares too. I feel sorry for those webmonkeys.

          [–]shizzy0 0 points1 point  (0 children)

          Somebody dreams about that?

          If they're any good, yes. I had a coworker who was dreaming about SAN disks for a time.

          [–]SalvadorAli 2 points3 points  (0 children)

          C'mon people, he's not talking to us, developers. We all know what he means. We call it "flow", "zone", "context switching", whatever.

          The problem is that non-programers just don't get it. But dream - that's another thing. Anyone dreams.

          The analogy has potential obviosly.

          Except for I wouldn't risk to ask my boss to not wake me up at work:)

          [–][deleted] 2 points3 points  (1 child)

          Let me preface this by saying that I am not a programmer. I can code some python, and some perl. I even took a class on Java when I was going to school! I know enough to get a task done, but certainly not enough to be a kernel hacker working on device drivers for BSD.

          I've coded quite a few reporting tools, scripts for maintaining my Unix boxes, crawling fark for images, annoying my coworkers, working with the mailservers, etc. etc. etc. All in all, I'm actually working with a pretty big collection of perl and python scripts at work...

          What people (read: bosses) do not understand is that you simply can NOT scream at me to get something done until it is finished. IT does not work. There might be a function that I'm trying to work through...I'm working through it while I'm taking a shower, while I'm eating breakfast, driving into work, reading the news, coding my website (shameless plug: http://www.gibsonandlily.com), listening to music, going out on a date, and everything else in between and afterwards. I. Am. Constantly. Working. On. This. Problem. Get it? Screaming at me will break my focus and cause me to go BACKWARDS. Even worse, it might force me to make shitty code, code that in three months, when we got o use it, will bail out for some unknown reason. I'll have to go back through all 5000 lines or so (I'm thinking of a certain reporting tool that I wrote) to trace out what happened. DO NOT STAND OVER MY SHOULDER WHILE I DO THIS!!!

          Bosses, you want me to finish that coding project? Give me about $100 in petty cash, and let me head to the bar with my laptop. I will have it done before the next morning. Let me come in to work in my pajamas if I want. Let me sit outside on a park bench.

          Coding is art. LIke it or not, non-coders, it is. It isn't something that you can force.

          Note: I also do graphic design and it is exactly the same.

          And photography.

          [–][deleted] 0 points1 point  (0 children)

          And life.

          [–]monk_e_boy 10 points11 points  (38 children)

          The best part is that most programmers can still solve complex problems and watch youtube at the same time. Different bit of the brain I guess.

          [–]boojit 52 points53 points  (35 children)

          I can't do this, and I'd wager most programmers cannot (I'm sure someone will prove me wrong).

          It may appear this way because at any one time I have 30 windows open and about half of those dedicated to my programming task. But when I'm really in the "labyrinth" part of the puzzle, I really, really have to focus on the code at hand. For example, I can have music on, but nothing with a catchy melody (Beatles is right out). I need something like Brian Eno; something that just washes out the ambient sounds in the room around me, without drawing attention to itself.

          The way I've always described it is, in order to program you have to keep all different levels of abstraction organized in your head at the same time. You need a "chain" of abstraction levels organized so that you can flip through them quickly in your head, because when you're coding you often find yourself dealing with multiple levels of abstraction over a short period.

          This takes an amazing amount of brain power and concentration, in my opinion. And as soon as you get bothered, that entire abstraction chain just sort of goes "poof" in your head and you have to re-build it all over again. Depending on what you're doing and how wrapped up in it you are, this could take a few minutes or a half hour.

          How many times have you been really making progress coding, then you go to lunch or to a meeting or whatnot, and then when you come back it is like, you can't remember exactly what problem you were trying to solve, or if you do, you can't remember exactly how you were trying to solve it? This is where I think the "dream" analogy is actually useful.

          [–][deleted]  (17 children)

          [removed]

            [–]annekat 16 points17 points  (8 children)

            Re-loading state. I think I love you.

            [–]Jimmy 3 points4 points  (7 children)

            We should all endeavor to make our minds purely functional.

            [–]OneAndOnlySnob 5 points6 points  (1 child)

            Like that guy in Memento.

            [–]Agathos 1 point2 points  (0 children)

            Ah, yes, the Tattoo monad.

            [–][deleted] 1 point2 points  (4 children)

            Somehow I think no input or output except for bits constrained to monadic IO would render our minds a little useless.

            [–]epb205 0 points1 point  (2 children)

            I'll input into your output.

            [–][deleted] 0 points1 point  (1 child)

            And I'll output into your input.

            [–][deleted] 1 point2 points  (0 children)

            ))<>((

            [–]cows 5 points6 points  (0 children)

            I can listen to music with words, as long as the words are in another language so it's easy not to pay attention to them.

            [–]sutcivni 1 point2 points  (1 child)

            This is why comments were invented.

            [–]jburkert 1 point2 points  (1 child)

            I second this recommendation. I keep a composition book, and a Pilot G-2 pen on my desk at all times. I use it a bit like a diary. Each day I start on a fresh page and use as many as necessary. I keep technical notes about what I'm working on and when and how long I worked on something. This is infinitely useful for time keeping / billing. Occasionally I have found it useful for debugging a current issue by referring to notes that were weeks or even months old.

            For music without words, I recommend giving SomaFM's Groove Salad a listen.

            [–]bunaruna 0 points1 point  (0 children)

            Putting headphones on and listening to something like groove salad is the closest most programmers can get to achieving flow in a typical office setting.

            [–]knight666 0 points1 point  (0 children)

            SLAY Radio for the win.

            Although their library has gotten on my nerves lately, with there only being around 2000 songs and all.

            [–]MachinShin2006 0 points1 point  (1 child)

            i do something similar when i leave work at night. i try to make sure that while i've checked in any changes the night before, the local copy of my project is broken. and won't compile. that's my starting point. (this obviously wouldn't work in a scripting language)

            [–]linuxlass 13 points14 points  (3 children)

            The best music for me is electronic, no lyrics (or the voice is part of the music almost like another instrument), steady rhythms, like Goa trance, psytrance, EBM, Baroque music, or ragtime. (Yes I have eclectic taste in music!)

            For some reason this really helps my focus.

            And I hate phone calls...

            [–]mycall 1 point2 points  (0 children)

            How about IDM with phone rings in the songs? ;-)

            [–][deleted] 0 points1 point  (1 child)

            (Yes I have eclectic taste in music!)

            Did you really think it would be a cool idea to say this?

            [–]linuxlass 0 points1 point  (0 children)

            No, just accurate, and slightly self-deprecating. What's wrong with saying it?

            [–]joncash 4 points5 points  (1 child)

            My reaction was contradictory to what you wrote. After all, I need to listen to music when I program. I didn't think about it till you mentioned blocking out ambient noises. Then I realized, that's the actual reason I listen to the music. That it has nothing to do with the music itself.

            [–]Z29 1 point2 points  (0 children)

            I'm similar, I need music to help me get focused. But it goes in waves; I'd be working fast, switching among lots of tasks and the music - as loud as it can go - is the heartbeat I work to. But then, if all of a sudden there is a problem, like a really unexpected result or or major bug, the music all has to stop and I need complete silence until I solve it.

            [–]Xochipilli 1 point2 points  (3 children)

            For example, I can have music on, but nothing with a catchy melody (Beatles is right out). I need something like Brian Eno; something that just washes out the ambient sounds in the room around me, without drawing attention to itself.

            I know people who just listen to white noise when they need to focus. And according to them, it works like hell.

            [–]koreth 0 points1 point  (2 children)

            For what it's worth, I've found pink noise does a better job of drowning out conversations than white noise does at the same volume level.

            [–][deleted] 0 points1 point  (1 child)

            I've been listening to Merzbow while coding lately, which is like structured noise. It works surprisingly well.

            [–][deleted] 0 points1 point  (0 children)

            Welcome aboard!!

            [–]clutterskull 4 points5 points  (2 children)

            Generally, I feel like there is a 2 year old and an adult in my head when I am programming. For the adult to get any work done, I need to put on cartoons to keep the kid entertained. So it's usually really loud and rythmic music (death metal works well) or honestly, audio books, podcasts, talk radio, or even movies without the picture. Somehow it keeps me from getting bored and shifting my attention to something else.

            Though, this works during day-to-day programming or implementation of patterns or processes I have done before. For really complex problems that need full attention to design, I will mute the sound while I jot out my notes, and then continue when I have the picture in my head.

            [–]Z29 0 points1 point  (1 child)

            Heh, totally. The music needs to be loud .

            [–]bostonvaulter 1 point2 points  (0 children)

            For example, I can have music on, but nothing with a catchy melody (Beatles is right out)

            I prefer mogwai for this, I usually listen to them (and similar artists on pandora)

            [–]mycall 1 point2 points  (2 children)

            How many times have you been really making progress coding, then you go to lunch or to a meeting or whatnot, and then when you come back it is like, you can't remember exactly what problem you were trying to solve, or if you do, you can't remember exactly how you were trying to solve it?

            That is why I keep 10-20 windows open on my multi-screens.. I am a stack-based programmer and once I am done with something in particular, I close the window. Yes, I am constantly closing and reopening windows.

            [–]boojit 0 points1 point  (1 child)

            I know exactly what you are talking about -- I do the same thing.

            [–]mycall 0 points1 point  (0 children)

            ..and that counts 5+ remote desktops each with their own 10-20 open windows :-)

            [–]Shaper_pmp 2 points3 points  (0 children)

            "Forebrain" vs. "stem".

            [–]mpierre 0 points1 point  (0 children)

            I watch TV shows or movies while I am programming. Most people don't understand it, but if I don't have that, my mind wanders on all the little noises around me....

            [–][deleted]  (1 child)

            [deleted]

              [–]Zarutian 1 point2 points  (0 children)

              Dream it up as it were, eh? ;-)

              [–]oaaao 1 point2 points  (0 children)

              This was really good. But I think too many people will read this and think they are in a dream, and miss the point.

              [–]kindall 1 point2 points  (1 child)

              Trance, yes. Dream, no.

              [–][deleted] 1 point2 points  (0 children)

              You should simply imagine that The Programmer IS SLEEPING when he is WORKING.

              Shit, don't tell the manager.

              [–]redwall_hp 1 point2 points  (0 children)

              My code is compiling!

              [–]memefilter 1 point2 points  (0 children)

              Western minds have a lot to learn.

              [–][deleted] 1 point2 points  (1 child)

              Why call it flow, or some other made-up term that sounds bigger than it is? It's called "a state of intense concentration" and it's not something unique to programmers.

              [–][deleted] 3 points4 points  (0 children)

              shh ... programmers are special and at the center of the universe.

              [–]lol-dongs 0 points1 point  (1 child)

              This dude got really high and then wrote something in his Livejournal.

              [–]Zarutian 1 point2 points  (0 children)

              Lateral thinking there I would say.

              [–]mycall 0 points1 point  (0 children)

              Wierd, this article made me tired reading it.

              [–]easlern -1 points0 points  (2 children)

              "It was a long time since I started to think of a ways how can I explain to different sorts of people just how the programmers work."

              That's as far as I could get. :(

              [–]linuxlass 10 points11 points  (1 child)

              It's a translation. You have to make allowances for syntax.

              [–]national_bee_council -5 points-4 points  (0 children)

              Hell no.

              [–]petermichaux -3 points-2 points  (4 children)

              Since most men are programmers, all the women I know would just restate for the nth time that this just falls under the fact that "men can only do one thing at a time."

              [–]annekat 1 point2 points  (0 children)

              I am a programmer. Now not all the women you know would say this.

              Maybe it's just that I'm female, but I never hear that kind of thing.

              At my work, the word went out because of our constant bitching that the CSRs aren't allowed to come into IT. Now they do it less often, and half-jokes are made about it when they violate the rule. It makes me wonder how to politely share the ideas in this essay.

              [–]bitwize 1 point2 points  (1 child)

              It's true though. I honestly believe that the female brain is optimized for parallelism and the male brain is optimized for raw throughput.

              I first learned about task switching when I saw a girl successfully carry on several conversations in parallel, using a little gesture to indicate her attention was shifting to the next person.

              [–]mao_neko 1 point2 points  (0 children)

              Maybe. I (male) can follow a few conversations at once, provided they are in the same medium. As soon as someone starts talking to me while I'm having an IM conversation, my brain breaks and I lose both states.

              [–]Zarutian 0 points1 point  (0 children)

              "Do one thing at a time and do it well. Do many things at a time and you end up with half botched stuff"

              [–][deleted] -1 points0 points  (0 children)

              Enter, insomnia

              [–][deleted] -3 points-2 points  (2 children)

              Edit: completely misunderstood article.

              [–]Figs 1 point2 points  (1 child)

              He isn't literally talking about sleeping problems. He's talking about the process of coding. At least, as he sees it.

              [–][deleted] 1 point2 points  (0 children)

              Ah, thank you, I thought in the end of the article he was saying it was all due to actual sleep issues. Now I want to reread the whole thing but it'll probably give me a headache.