Programming on Autopilot

Recently a good friend of mine and fellow programmer talked about his experiences with ‘programming on autopilot’, as he described it to me and other friends in an email:

[…] Sometimes I realize it’s happening as it is happening. It’s like I see myself in some sort of a dream. I’m not aware of any particular part of my mind that is thinking about programming. It’s like I am mindlessly cutting and pasting things out of my subconscious. I look at my screen and my eyes cross. I don’t even know what I’m doing. I don’t really know what the words say, but everything compiles, and everything works. […]

If I ever go back and carefully inspect things with my brain turned on, everything looks okay. Things are documented. Resources aren’t wasted. Functions are cohesive.

He asked if the experience was familiar to any of us and if we thought it was good or bad. So I felt like sharing my response, pasted below.

My Response

It sounds familiar. I feel like I once wrote code with that kind of mentality, although by its very nature it is not easy to exactly say, “Oh yeah I did that.” But I am still sure I zoned out during programming at some point.

Nowadays I tend to take the opposite approach when programming. I try to maintain an acute awareness about what I am doing at all times, to the exclusion of my environment, e.g. I won’t answer my phone or even the door in the middle of writing a function. I feel like nowadays I program more slowly because I spend a lot of time methodically planning out what I intend to do. Like I will periodically just read my code; not looking for bugs or anything, just reading it in my head, both to stay focused on it and also to ‘listen’ for anything that sounds awkward, maybe a function name that sounds too general, or a variable name, or anything else. A lot of my programming time is also spent consciously deleting code, throwing away everything I can until I have only what is essential.

I think both approaches have pros and cons, and I do not believe either is superior to the other. For example, one con to my approach is that I feel mentally fatigued rather easily. I never write code without listening to music (unless it’s under some extraordinary circumstances) and that acts as a tether to the rest of the world, so that at least some part of my brain isn’t thinking about the code that every other part is focusing on. I get physically fatigued more easily nowadays anyways, and trying to maintain an incredibly narrow mental focus on code for long stretches of time certainly doesn’t help.

I’ve naturally fallen into that routine, so maybe that is just what works best for me right now. I’ve heard about all kinds of different ways to approach programming, and I don’t believe there is any one methodology that suits everyone. I suspect that over time we all naturally adopt the approach that is best in accord with our capabilities.

Advertisements

4 thoughts on “Programming on Autopilot

  1. I never really thought about it as being on autopilot. Sometimes I get a feeling after maybe after writing a bit of code, where my time has just disappeared and I have code sitting there infront of me. I don’t think it is necessarily a bad thing especially if you are writing mundane code but I think it gets dangerous if you are fixing a bug, you end up just hacking at the problem and not truly solving it.
    That is my experience anyways, nice post.

    1. > I don’t think it is necessarily a bad thing especially if you are writing mundane code but I think it gets dangerous if you are fixing a bug, you end up just hacking at the problem and not truly solving it.

      I agree, that situation is dangerous. Although I believe all of us put ourselves in that position sometimes not because of our level of conscious attention, but due to our willingness to ‘get the job done’ even if we do not understand the solution. I can’t count how many times I have struggled to fix a problem until finally I bang out the solution without fully understanding why it corrects the issue. And inevitably that comes back to bite me.

Add Your Thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s