Scott Hanselman

Coders: Context Switching is hard for both computers and relationships

April 4, '19 Comments [10] Posted in Musings
Sponsored By

Coders: The Making of a New Tribe and the Remaking of the World

Clive Thompson is a longtime contributing writer for the New York Times Magazine and a columnist for Wired and now has a new book out called "Coders."

"Along the way, Coders thoughtfully ponders the morality and politics of code, including its implications for civic life and the economy. Programmers shape our everyday behavior: When they make something easy to do, we do more of it. When they make it hard or impossible, we do less of it."

I'm quoted in the book and I talk about how I've struggled with context-switching.

Here is TechTarget's decent definition of Context Switching:

A context switch is a procedure that a computer's CPU (central processing unit) follows to change from one task (or process) to another while ensuring that the tasks do not conflict. Effective context switching is critical if a computer is to provide user-friendly multitasking.

However, human context switching is the procedure we all have to go through to switch from "I am at work" mode to "I am at home" mode. This can be really challenging for everyone, no matter their job or background, but I propose for certain personalities and certain focused jobs like programming it can be even worse.

Quoting Clive from an ArsTechnica article where he mentions my troubles, emphasis mine:

One of the things that really leapt out is the almost aesthetic delight in efficiency and optimization that you find among software developers. They really like taking something that's being done ponderously, or that's repetitive, and optimizing it. Almost all engineering has focused on making things run more efficiently. Saving labor, consolidating steps, making something easier to do, amplifying human abilities. But it also can be almost impossible to turn off. Scott Hanselman talks about coding all day long and coming down to dinner. The rest of the family is cooking dinner and he immediately starts critiquing the inefficient ways they're doing it: "I've moved into code review of dinner."

Ordinarily a good rule of thumb on the internet is "don't read the comments." But we do. Here's a few from that ArsTechnica thread that are somewhat heartening. It sucks to "suffer" but there's a kind of camaraderie in shared suffering.

With reference to "Scott Hanselman talks about coding all day long and coming down to dinner. The rest of the family is cooking dinner and he immediately starts critiquing the inefficient ways they're doing it: "I've moved into code review of dinner.""

Wow, that rings incredibly true.

That's good to hear. I'm not alone!

I am not this person. I have never been this person.
Then again, I'm more of a hack than hacker, so maybe that's why. I'm one of those people who enjoys programming, but I've never been obsessed with elegance or efficiency. Does it work? Awesome, let's move on.

That's amazing that you have this ability. For some it's not just hard to turn off, it's impossible and it can ruin relationships.

When you find yourself making "TODO" and "FIXME" comments out loud, it's time to take a break. Don't ask me how I know this.

It me.

Yep, here too 2x--both my wife and I are always arguing over the most efficient way to drive somewhere. It's actually caused some serious arguments! And neither one of us are programmers or in that field. (Although I think each of us could have been.)
From the day I was conscious I've been into bin packing and shortest path algorithms--putting all the groceries up in the freezer even though we bought too much--bin packing. Going to that grocery store and back in peak traffic--shortest path. I use these so often and find such sheer joy in them that it's ridiculous, but hey, whatever keeps me happy.

This is definitely a thing that isn't programmer-specific. Learning to let go and to accept that your partner in life would be OK without you is an important stuff. My spouse is super competent and I'm sure could reboot the router without me and even drive from Point A to Point B without my nagging. ;)

However we forget these things and we tend to try and "be helpful" and hyper-optimize things that just don't need optimizing. Let it go. Let people just butter their damn bread the way they like. Let them drive a mile out of the way, you'll still get there. We tend to be ruder to our partners than we would be to a stranger.

That’s part of the reason why I’m now making all dinners for my family ;-)

LOL, this is also a common solution. Oh, you got opinions? Here's the spatula!

What do YOU think? How do you context switch and turn work off and try to be present for your family?


Sponsor: Manage GitHub Pull Requests right from the IDE with the latest JetBrains Rider. An integrated performance profiler on Windows comes to the rescue as well.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Wednesday, April 10, 2019 10:21:21 PM UTC
I'm sad to say I've done this to my wife on many occasions. She'll be doing some task around the house, and I'll either suggest how it can be done more efficiently or sometimes even take over completely. Never really put two and two together that this is bleed over from my daily habits as a programmer. This is something I'm definitely going to have to keep in mind and pay closer attention to.
Thursday, April 11, 2019 1:37:20 AM UTC
Really interesting article, and very timely. One of the issues I've been fighting personally is stress and I've been working on this for years. Stress has had a serious impact of my life and as I've been working on this, one of the biggest findings was that despite the fact that I "thought" I was handling Context switching well, the simple fact is I wasn't, which means I was bringing stress from home and work together and aggregating them into a nightmare. One of the things I've found that helps is making yourself take scheduled breaks and setting rules for yourself to help with these types of transitions.

For example, a simple rule I implemented was "I will never again eat at my desk." I work from home and force myself to physically leave my office to go eat lunch. This makes me context switch because I have to acknowledge that I have walked away from the room where I work and must let go of anything I'm holding onto. I also block my lunch hour on my calendar to make sure I context switch.

Also put in place the no cellphones in the dining room of the house, meaning I can't bring my phone to the table. Now I have had import calls that require me to step away.

And finally unless I am traveling, my laptop is not allowed to leave my office. This has re-enforced that when I'm "at work" I'm at work, and more importantly "When I'm not", I'm Not.
Thursday, April 11, 2019 9:07:37 AM UTC
Very close to home for me. I had an otherwise very happy 6 year relationship break down for pretty much this reason.

It's too late for me but I'm hoping others can learn from this. These things add up and are incredibly important to get on top of.
Tom Higson
Thursday, April 11, 2019 9:41:18 AM UTC
I hear Kevin. I don't like working from home because I have a hard time getting into "work mode" and when I'm in there, I have a hard time getting into "home mode" afterwards. I like to have different physical locations for work and home. That way I can both physically and mentally separate work and home. I've caught myself in the past, after working from home, thinking "I can get a little more done, just one more line of code or one more problem". That is however, a street without end (an adage literally translated from dutch "een straatje zonder eind"). At a certain point, I have to say the rest is for tomorrow, because there will always be more work.
Thursday, April 11, 2019 12:46:10 PM UTC
I try to empathize by remembering how I felt the last time someone ranted excessively about something I either didn't understand or didn't care about, particularly when I had other concerns. If I'm going to rant a little bit, the least I can do is try to package it as something that makes sense to them. When I do that it often turns into something brief like, "I made some great stuff today!" or "Today was frustrating because a stupid person wanted to make me do stupid things."

If my mind is entirely one something my family can't understand or even relate to then in that moment I'm still at work, and I'm not really with them. When I sense that disconnect it reminds me that I need to do one thing at a time, and right now that thing is hang out with my family.
Thursday, April 11, 2019 2:55:34 PM UTC
Scott, I find your blog posts SO interesting - even when they are about things that I'm not particularly interested in! This one is, luckily, not something I have too much trouble with, but so many of your posts are just plain fun to read and think about. Keep up this good work!!!
Thursday, April 11, 2019 4:07:17 PM UTC
I think that for those that commute, the commute time serves as a good buffer for that where the mind can transition over a few minutes, you can listen to the radio and think about other things for a few, but for those of us that work from home, there often is no transition time, so I try and create an artificial buffer for a few minutes, either walk the dogs, take a power nap, play some games, or even just watch some funny youtube videos for a few, anything that gives me that same solitary buffer time before I'm ready to switch over to "home mode". Hope it helps!
Aaron
Thursday, April 11, 2019 6:47:12 PM UTC
I ran into this problem about 4 years ago when I worked for a company where we had a lot of overtime due to the fact that our client was in the US and we were 6-7 hours ahead. It was awful. I came back from work, my wife served the dinner, my daughter asked me to play with her, but I had to connect to work to finish something off. The money was great, but at the expense of the family. It hit me back then that I stop working from home. I wanted my wife and daughter to know me as husband and father, and not as a programmer. Soon after I left the company, found another one that was better paid and there was no overtime.
Husein Roncevic
Friday, April 12, 2019 6:34:52 AM UTC
For me, it's a much deeper problem (think challenge) than us programmers being addicted to optimizing things. It is the fact that mankind is addicted to obsessive thinking in general at this stage of its evolution. And as long as its thinking is not connected with a deeper sense, it only revolves around itself and typically creates more problems than solutions and no permanent satisfaction can be achieved.

Luckily, nowadays more and more people wake up and look further. In this age of information, there are great places to start the quest. For example soundstrue is doing a great job of gathering information and presenting that to the world.

In my case, context switching is (and sometimes still is) very challenging. Only through body-awareness work and with lot of practice and dedication, I can switch rather easily to being a loving and present father of four children.
Dejan Appenzeller
Friday, April 12, 2019 4:59:06 PM UTC
I have to spend some time unwinding from work. Listening to music or walking or playing some video games to detach from the world, so I can reattach without the excess problem perceiving/solving of coding being part of regular life.
Benjamin
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.