The Bane of Developers - Context Switching!

The Bane of Developers - Context Switching!

• 96 views
vlogvloggervloggingmercedesmercedes AMGMercedes AMG GTAMG GTbig techsoftware engineeringsoftware engineercar vlogvlogssoftware developmentsoftware engineersmicrosoftprogrammingtips for developerscareer in techfaangwork vlogdevleaderdev leadernick cosentinoengineering managerleadershipmsftsoftware developercode commutecodecommutecommuteredditreddit storiesreddit storyask redditaskredditaskreddit storiesredditorlinkedin

From the ExperiencedDevs subreddit, this developer wanted help with context switching.

📄 Auto-Generated Transcript

Transcript is auto-generated and may contain errors.

Hey folks, I am just heading home from work. It's Friday. We're going to go to the experience devs subreddit and this one's about context switching. And I don't know, the post is kind of seems like a little bit generic. I think there's some more followup cuz some people were asking questions cuz it seems a little generic and essentially kind of pointing out that this person is like um they're experiencing a lot of context switching. They were saying often things are blocked and unblocked on the order of minutes, which to me I'm reading that and going like what the heck. Um, I don't think they necessarily mean they're context switching every couple of minutes, but I think that their point is that stuff is changing that fast and perhaps they have this uh uh I don't know additional stress or pressure because of that. So, whole idea is context switching.

they were saying, you know, they struggle with this or trying to, you know, do some, you know, note takingaking and stuff like that to try and make sure that they can stay on top of stuff, but often, you know, they're they're dropping things because they're like, I can only really seem to manage maybe two, maybe three things uh at a time and then otherwise it's kind of uh falling apart. So, um, they go on to say that they believe that, you know, from what they've been reading or hearing that maybe it's sort of like this, I think they were saying it's staff level. Um, maybe that's sort of just something you start to expect that there's tons of context switching. So, I thought this would be good to talk about.

Um, if you're new to the channel, uh, I generally make videos where I'm doing, uh, responses to submitted questions, but if I don't have any, then I go to generally experienced dev subreddit, try to look for something interesting to chat through, and then offer my perspective on it. And I always like reminding people that uh, my my goal here is not to tell you here's my opinion. It's the the only way. It's kind of like here's stuff from my experience, here's some of my perspective and I will try as best as I can to try looking at things from different angles. So hopefully we can think about it in interesting ways and at the end of this you know my goal is not to convince you of anything just to get you thinking and and hopefully there's something helpful for you. So with that said context switching.

So yeah, I think as someone you know in my role in particular as an engineering manager, I I have context switching an awful lot and um I've worked in a startup before where it felt like context switching all the time. I work on platform teams and in particular do a lot of security stuff right now and find myself context switching an awful lot. But as an engineering manager like I kind of expect this for myself. Uh I like this person's saying I kind of uh for for my role and my level I'm like I just expect that I'm going to be doing this a lot and um one of the things that is important to me though is that I know that context switching is costly and I know that it's costly for me right if I think about my own role as an individual I know that's costly for me um even like you not not coding at all.

Just like in my role, it's it's costly to have to jump between like maybe I'm analyzing data for something, maybe I'm going to review a doc, maybe I'm reviewing code, uh going to a meeting, right? One-on- ones, like context switching has a cost. And so I fully do recognize that. But the other part of the the picture here is for me at least I really want to make sure that given the cost of context switching I am minimizing that as much as possible for my team. And so uh the word or phrase I would use a lot like two of them are like kind of sheltering or or shielding. And uh I I want to be able to do that for my team members. Not to um not to isolate them or because like they can't handle the information or something like that, but it's more that I I want to make sure that for whatever is coming up that they're not at the front of that being randomized and having to context switch.

uh you know, I want them to do that as little as possible because the reality is there always will be things to context switch for. There always will be some priority that comes up. There always will be uh at least for for what we're doing, there always will be the circumstance where there's something that is that is on fire or there is something security related and we do have to context switch and do it quick. And that's that's kind of the reality of the space we work in. But it's like instead of trying to uh you know make this thing go away and say how do we eradicate context switching the way that I look at this is like how do we make sure that we can minimize it and work effectively so that when it does happen and it is unavoidable that it's at

least minimized right and that we can sort of recover or uh bounce back from having to context switch effectively right so again not not about eliminating it but reducing it and then sort of uh being able to to do so as effectively as possible. So um yeah, in in my role generally I I try to almost make myself a sponge for that where if if I can take on the context switching, if I can take on some of the chaos to to sh uh to shield my team or to shelter, um then I will, right? I would much rather that I'm forced into context switching that it's inefficient for me. Uh, as much as I, you know, I don't love that, I would much rather that I'm at the front of that so that I can help my team focus on what they need to. I recognize that doesn't scale super well.

And so, uh, the way that I see this though is that like I don't I don't have like other sets of resources to be able to, uh, to lean on. like I have uh my awesome team, but like it's not like I can be like, "Okay, cool." Like, "Let me go let me go use this other team that I have." Like I I don't I don't have uh that kind of thing going on. So, I need to make sure that uh you know, the the team that I have, I need to make sure that they're as effective as possible. So, that's like from my perspective, right? um and and how I'm kind of looking at working with my teams. But obviously to kind of chat through this, we we need to think about like what can you do as individuals? Like maybe are there things or practices your teams can do?

Is there uh stuff that you can ask your manager for support on? And this is all going to be super situational, of course. And I'm going to need one sec here just to focus on switching lanes cuz this part of the highway is kind of kind of crap. Um, it's really dumb. I don't know if you watch enough of my videos, you might know the part of the highway that this is for me, but it's like there's a line of traffic to my left. They're all trying to get to the next exit. Um, and the exit that I need is also the same as the on-ramp for all of this traffic that's piling up. And I have to cross it. Then I get onto the next highway and I have to move across all the lanes of traffic to get into the the fast lane because otherwise cars are just piled up not moving.

So it's a fun backto back little bit of lane switching. But yeah, so given that it's going to be very situational, I want to try to cover some ground and just talk about different ideas, right? uh as an individual, let's start that way. Uh I would say like as this person kind of said, yeah, there's there's going to be more and more context switching uh arguably the more surface area that you're kind of involved with because there's more things moving, there's more moving parts. And uh I I think that that can become overwhelming for sure, but I think it's about how you manage that and uh and how you kind of set some boundaries for yourself. And I'm saying this like I know it's easier said than done. It's not you snap your fingers and like instantly boundaries have been set and you can manage your time and and all that.

Uh I know that's not how it happens, but I think we have to think through that. One sec. Sorry. You let me in. Thank you. One more. Come on. See, I'm in I'm beside the fast lanes at a dead stop. Oh, I should have went. We're going. Nice. Okay. Um, so yeah, like having this awareness that like you do need to set some boundaries and I would say time boxing things is really critical here too. So when I was reading this person's post and they're talking about um you know things things change on the order of minutes, the first thing in my head was like I hope to God this person isn't context switching every couple of minutes because like I mean I mean it's a good starting point to say okay like here's what we're going to do to try and and improve this.

like you you need to carve out some space for yourself cuz some of the things they ended up list uh listing were like responding to messages uh responding to request to review code, getting responses in code reviews or you know whatever else. They have a list of very common things that happen in software engineering. Um, but like if if you're letting notifications and stuff like that distract you on the order of minutes, then like my suggestion is like that's the number one thing to go address, right? Make sure that you can block off time, right? So, I'm just going to make up some examples here, right? But please understand that you can tailor this and you would need to tailor this based on your needs. But um say on a given day right on a it's a Tuesday and on Tuesdays you have some sets of meetings.

So you work 8 hours and maybe you have 2 hours of meetings in the day. I don't know, right? So you have six working hours. Uh let's let's pretend there's no such thing as lunch or breaks or whatever. So you have 6 hours to kind of do do work. What I would recommend is trying as best as possible to like carve out time to do specific things. So what do I mean by that? Well, if you have maybe for you like getting some some focus work first thing when you're like sitting down to do work is the best. So okay, like you know turn off your notifications, you know, minimize your Teams or Slack or whatever you're using. Don't look at it, right? Notifications are off. If you're not looking at it, you're going to code and you're going to block off uh 2 hours for that and that's it, right?

Like you you literally set that up as a boundary for yourself and you try to respect that because that's respecting your time and your space, right? So, you know, are people going to message you in those two hours? Yeah. Are are you going to get emailed? Yeah. Are you gonna forget some days to turn off notifications for stuff? 100%. But the point is that as much as possible, carve out some time for a task like coding in this example and try to stick to it. Try to minimize the distraction so that you can maximize sticking to what you need to do in that time. Now, if you're going to go follow this pattern and you're like, "Okay, well then I'm going to go block out an hour for this after or two hours after or whatever, um, and you're trying to to fill your calendar this way." And by the way, I I genuinely would recommend like block off time in your calendar.

And and why? Because if you block off time in your calendar and someone tries to book you for something, you're busy. At least you can make a decision, right? someone sends an invite or they want to send an invite, they're like, "Ah, Well, Nick's busy at that time." Yeah, cuz I blocked off my calendar to do something, they might still send an invite and say, "Hey, like I know you were busy. Sorry." Or maybe you work with people that don't even do that. Um, and they send an invite. You can say like, "My calendar's blocked. Like, I'm busy during this time." Or you read what they're inviting you for and you go, "Actually, this is more important. Let me let me go rejig my calendar." Um, so yeah, block it off in your calendar. But if you're going to go filling your calendar with these with these blocks to go focus on stuff, just keep in mind that you'll probably want to carve out gaps, right?

Allow yourself a bit of a break in between things. Might sound obvious, but like for those of you that are kind of going through this this mental exercise of like, oh, how could I go how could I go do this? Yeah, give yourself some breaks in the middle, right? like literally could be a bio break, maybe go get some water, whatever. Um, maybe you want to carve out I'm just making this up, right? Maybe you give yourself 15 minutes so that you can go respond to notifications and things like that because maybe uh you're stressed out about that. Or maybe you want to bake that in so that you have a you know if say you're working for an hour or two hours and you're not responding to anyone and you're like okay like it's been 2 hours like I I feel that that's fair that I can go respond to people then yeah go do that right but you are setting some boundaries for yourself and for others.

So, you go work for 2 hours, you take a 15-minute break for, you know, bio, respond to stuff, and then cool. Now, you're going to do another uh 45 minutes or or 75 minutes, right? Um and instead of coding, you're like, well, I have to get through my design doc. I need to make some progress on that for this other thing, right? Because a lot of us, especially going back to what this person was saying, they're at a staff level, right? So when you start, you know, growing growing in level and having more responsibilities, odds are you're probably working on more than one thing at a time. I don't I don't think it's ideal to have tons of things to work on at the same time. I think there's there are costs even if you're not rapidly context switching, there's cost to context switching. So if you're like maybe you want to use the whole Tuesday to to code as much as you can, like do that.

Um, but maybe you want to carve out some time for design doc writing or something else. You know, again, block off the time and go do that. Um, that's my like honestly my number one recommendation is trying to get in the habit of blocking time and be be kind to yourself because what you don't want to have happen is that you try something like this and then uh because I'll I'll tell you right now it's not going to be perfect and if it's not perfect and you're getting frustrated because you're like, "Okay, it's the first day I'm trying this and you know, I got interrupted five times in my two-hour coding session and like this is the dumbest ever. Doesn't work. Like, keep like be kind to yourself. Keep trying. You know, the goal is not that you're going to eradicate uh context switching and interruptions.

You won't. There will always be something, but the goal is to try and minimize it so that you can maximize your productivity on certain things that you need to focus on. Okay, so that's part one. Um, I would say like another thing that I would I kind of mentioned two things, right? Like are there things in your team that you could do and are there conversations you could have with your manager about getting, you know, more support on this? Uh, on the team thing, I like one thing that comes to mind uh especially with things like code reviews or like design doc discussions and reviews. Um, I think one thing that comes to mind for me on this is that the there's kind of two sides.

If you're someone who has a code review that needs attention or you have a design dock that you need reviewers on, um there like to me there's nothing worse than like you know you you have this ready, you're asking for feedback and then no one does anything cuz you're like I've done as much work as I can on this thing and like I literally cannot progress on it until these things happen. This is again why I usually say that uh when you're growing in experience and responsibilities, you'll probably have multiple things. If you only had a design dog to work on and you needed to wait for feedback, do you just like not have other work to do now? Like that doesn't really make sense, right? So, it's really really shitty to have to be waiting and then no one's engaging on it.

So my one of my recommendations and I encourage you to talk about this with your team, come up with something that works is that I do recommend that people go to a team chat or whatever you use for communication on a regular basis. And like when you're looking for your pull request to get reviewed, sure, maybe there's emails that go out. If you're like me and you get a ton of emails, like I don't I can't I physically cannot read all of the emails that come into my inbox. I don't I quite literally don't have time to do that. So, um generally I would say like, okay, you got emails that come in, that's a good start. I would recommend you ping people on the team. you put it into a group chat and say, "Hey, can I get some reviews on this?" If there's especially people that are subject matter experts, tag them and say something along the lines of like, "Hey, this is ready for review.

When you get a chance, can you check it out?" Right? How how that actually looks in terms of implementation, debate that with your team, come up with something. But the reason I like this is because uh it's kind of counter to what we're talking about, but I think that people if you say uh you know I hey I'm going to have this pull request ready and like it'll be up today and can you check it out when it's ready of people on your team will be like hell yeah for sure. Like I'm happy to help. Great. And then what's going to happen is like they're busy doing their own And they were genuinely happy to help, but they're they're busy and they're distracted doing their own stuff, like rightfully so. And then it gets delayed. And then they start the next day and like what's on their mind?

Like probably to go do their own work. Um, and so it's not that like people don't want to help you. It's just that like if they're also doing their own stuff, they're probably thinking about that. Maybe if they were time boxing some uh, you know, some dedicated slots for code reviews, like maybe this would help more. I don't know. But point is, I think it's totally normal and I would say expected that people, you know, I'm going to say like get distracted uh from from your asks to go focus on their priorities. So, one way again to to help with that is to kind of ping the team or ping individuals in a group chat and like, hey, this is ready. Could I could I get your eyes on it when you're available? And it's one more opportunity to kind of surface it for them. And the reason that obviously sounds counter to what we're talking about is like hey like isn't that isn't that a distraction?

Isn't that a context switch? Like yes it is if people drop everything they're doing and then immediately go switch over to it. But imagine you're the person receiving this and you're 17 minutes into your 2hour coding session. I said turn off your notifications. I said minimize your Teams or Slack, right? Like get that out of sight, out of mind. Focus on coding. Now, after your coding sessions done, hey, look, you've been tagged in a chat. Cool. Well, okay, you're still not doing reviews until later in the day, right? When you block that off for yourself, or maybe that's a tomorrow thing, but this person is saying, "Hey, look, it's ready. you might actually change your mind and reschedu some stuff so you can get to it that day. Whatever that looks like for you. Point is that uh you can minimize the context switch even with someone tagging you by just being more like regimented with your notifications.

So I recommend people tag um you know put in a group chat, tag a couple of individuals. I would say like tagging a whole team and saying like hey everyone this is ready. Um, I don't know. I feel like you get some bystander effect where like everyone's been notified, but unless you have people that are always willing to jump in, someone might be like, "Well, Bobb's going to get to it, so like I'll I'll do it later or I'll check later if I get to it." So, I would I would recommend tagging a couple of subject matter experts and otherwise just uh tagging one or two people to at least get some eyes. Now, same thing with design docs, right? Hey, this is ready. When you get a chance, could you review it? So, I'd recommend that. But this is of course something talk about it with your team.

Um, and even if it's not this idea, right? If you're like, "Nick, that's the dumbest I've ever heard for code reviews and design docs. I would hate to do that." No problem. Like I said at the beginning of this video, I'm not telling you what to do. I'm just getting you to try and think about things. So, cool. You're probably not the only person on your team that thinks about context switching. In fact, if you're on a team, I can probably guarantee you're not the only person thinking about it. Uh so talk about it with your team, right? Like I don't Do you have Do you have retrospectives? Do you have any type of forum for that kind of stuff? If not, can you put it into the chat? Are you at a an office physically and you can, you know, walk over to some people and start talking about it?

Have a discussion about this, right? Hey, I noticed that I'm doing a lot of context switching. Um, finding that it's hard to keep up with pull requests or design docs or whatever it is like, how are you guys navigating that? Get a conversation going. Right? If other people are also experiencing it, is this something that you can talk about together and say, "Hey, I wonder if we do something a different way that we can minimize that, right? Can we set some expectations with each other around code reviews that um you know, if I'm not getting to your code review instead of you harassing me to go do it, like you know, you can delegate to so and so like I don't know, like come up with plans, work on it together." So the third sort of part to this I was saying like how do you get support from your manager?

Um, the reality might be that you're working on stuff and even though you're trying to time box and balance things out and all this kind of stuff, you might be working across uh different areas where like your attention is being demanded and despite your efforts to try and you know time box and set some boundaries like it's like it's starting to feel like unrealistic. And what I mean by that is that you're like, "Okay, like this this guy Nick was saying go time box some stuff and trying to do it, but I literally have too many obligations where people depend on me for whatever it is." Um, and if I'm not responding to people at some cadence, like I literally can't block off time like that, right? and then the side effect is I'm being constantly randomized and too much context switching.

I would say this is a great conversation to have with your manager and just to kind of to bring it up as a unless you have solutions already and things you want to propose that's great but if you don't talk about it right say like hey like one of the things that I want to talk about in my one-on-one is that I'm having some challenges where I feel like I'm constantly being pulled between things and I'm having some difficulty prioritizing my time for that. Uh, I want to be effective, but uh, and based on your situation, I don't know what that looks like. Is that just a matter of like you're juggling too many things? Is it because you have a couple of things that, you know, maybe it's not a lot of things, but the couple of things you have are so on fire or require so much attention that you just need extra support even for one of those things.

So, this is the kind of thing that I would encourage you to talk about with your manager. Bring visibility to it. And I think that some people uh may avoid this kind of thing. Because I mean, there could be many reasons, but if you watch the last video, maybe you think your manager is incompetent, so you're like, why would I ever do that? They're not going to help anyway. Uh or maybe I think something that's common is that people see this as maybe they're like, "Well, if I say that I'm I'm admitting that I'm, you know, it's a weakness. I'm not good enough, right? I've been assigned all this stuff. I'm responsible for all this stuff and it's feeling overwhelming because I'm context switching so much. I must not be good enough, right?

I better not bring that up because that's going to look bad." This is a Like if you if I'm saying that and you're like, "Yeah, that's kind of how I feel about it." I just want you to know that this is kind of like a it's a bit of a paradox because the at least in my opinion, again, I'm only only one manager and only one person, but my opinion on this kind of thing is if if you're worried about seeming like you're stupid, not capable, um I don't know, like whatever it is, like you're you're not enough. Um, if you're worried about that and then you like hold it in and you try to like hide it and you try to work around it, couple things happen. One is that it's going to keep adding a ridiculous amount of stress to you. Hopefully, you get through it and then, you know, great, you you're back on track and you survived.

Great. Awesome. But I think the other thing that can happen is like if that continues to pile up, the um the reality is like more stress for you and probably you're going to start dropping the ball more. And so why I say it's a paradox is because you were trying to avoid looking like you weren't capable, right? this fear of like I don't want to admit that I need help because I don't want to look inferior uh or that I'm not capable of doing something instead of raising awareness and and getting help and working with your manager and getting support from your team instead of doing that you avoid it and then what happens is like it's a self-fulfilling prophecy because now you are dropping the ball now you can't manage all these things now you do need support for because everything is crumbling. And by the way, the stress didn't get any better along the way.

So instead of trying to run from this kind of stuff and hide, I would just encourage you like try to find the opportunity to to raise awareness to it. I would also say for those of you that immediately went, "Well, that's also really stupid, you big dummy." because my manager would totally like, you know, put me on a pip if I said anything like that. Uh, I don't know, probably not in a great spot in the first place. So, like, like if if that's the kind of environment you're in where for real, people are going to be a piece of to you for uh for, you know, admitting that you need help, like especially your manager. They're not trying to support you. I would say you're probably not in a good spot to begin with and uh we should be having a different conversation already anyway.

But yeah, I think raising the awareness to your manager and then if you have suggestions around like you know if there's particular projects or I don't know activities where you're like it's you know it's this one that's demanding all my attention or context switch uh cost like if you understand that for yourself great like share that right the more that you can kind of share the context for your manager then I would say hopefully the better that they can help and I say this as someone When people submit questions to me, if they're like, "I have a problem with stuff." And I'm like, "Okay, well, if you tell me more about the problem, I'm not saying I can, it's a guarantee that I can fix it, but like if you tell me more about it, I can at least try to navigate that with you more specifically instead of having like generic shitty advice." Um, so I would just encourage you to to try and do that.

Oh, come on. Please go faster. Please. today. Oh my goodness. Oh, the irony of uh seeing a 911 driving school sticker and student driver on the back. I'm so sorry. Um they made the turn. They did it. Okay, so three levels. One is trying to work on some ideas for yourself and time management. I suggested things like doing some time boxing, setting some boundaries. There are plenty of different things for this, right? Some people might use a pomodoro. Um there's there's lots and I'm not saying this fixes everything, but I would highly recommend you try to explore some things and work on like this vector of of time management. Next part is around like can you talk to your team about different things, right?

Are there different things the way that your team works that as a as a team you can do things to have less context switching on the cost on each other because I can assure you that if you're on a team there's going to be other people that have some of these challenges. And then the third is like and I should mention these aren't mutually exclusive. You can't do all three. Uh talk to your manager, right? raise awareness. If you have uh identified particular things that you would need more support on or what that looks like, talk about it. And please don't uh don't don't see asking for help as I must not be capable because it's so much shittier to be in a situation where like you didn't say anything and then really hits the fan because you couldn't you couldn't do any of the things that you were asked to do.

You were stressed out and just couldn't get any of it done. So that's my take on that. Um there's so much more to discuss on that. If you have particular, you know, things that you're navigating that way, like please leave a comment, you can submit a question at codemute.com. You can submit stuff anonymously that way. But yeah, if you have specific scenarios like that and you're like, "Cool, like we do code reviews this way or uh my manager always does blah and it sucks." Like, send it in. Let's chat about it. Cool. Well, my mic's about to die. Just on time. Thanks for watching. I'll see you in the next video.

Frequently Asked Questions

These Q&A summaries are AI-generated from the video transcript and may not reflect my exact wording. Watch the video for the full context.

How can I use time boxing and calendar blocking to reduce context switching?
I would turn off notifications and block off time for focused work (for example, two hours) so I can concentrate on a single task. I would block that time in my calendar so I'm busy and can decide to reschedule if needed. I would also build in breaks between blocks to avoid burnout and to help manage interruptions.
What strategy do you use to minimize context switching when code reviews or design docs are waiting for feedback?
I go to a team chat and ping the team when I need a pull request reviewed or design docs looked at. I tag a couple of subject matter experts to surface it so someone can check it out when they have a moment. I find this approach helps surface reviews so they can be addressed when people have a moment to look at them.
How should you involve your manager when context switching becomes overwhelming?
I would bring it up in a one-on-one and describe that I'm having challenges staying on top of multiple priorities due to constant context switching. I want to be effective and I'm looking for guidance or extra support. I emphasize that asking for help isn't a weakness and that bringing visibility to the issue can prevent bigger problems.