Episode 64
Taking Breaks
January 22nd, 2025
39 mins 12 secs
About this Episode
In this episode of the Acima Development Podcast, Mike and Ramses dive into the importance of recognizing and respecting mental and physical limits to maintain productivity and avoid burnout. Drawing a parallel to endurance sports like marathon running, Mike explains how the depletion of glycogen reserves mirrors the mental fatigue that can occur during intense problem-solving in software engineering. He shares a personal anecdote about his experience with low energy and poor decision-making while working in landscaping, emphasizing the value of taking breaks to restore mental clarity.
The conversation explores practical strategies for managing mental capacity in high-cognitive tasks, such as stepping away from work, engaging in light physical activity, or shifting focus to a simpler task. Ramses shares his approach of taking regular breaks and prioritizing tasks based on energy levels, while Mike highlights techniques like the Pomodoro method and mindfulness practices to improve focus and productivity. Both agree that recognizing when to pause, reflect, and reframe assumptions is essential to navigating complex problems effectively.
Mike concludes by underscoring the importance of regular mental “maintenance” to avoid burnout, likening it to routine upkeep for a car. By sharing personal stories and actionable tips, Mike and Ramses provide listeners with valuable insights into balancing productivity with rest, fostering a healthier and more sustainable approach to work. This episode serves as a reminder that taking breaks isn’t a sign of weakness but a key to long-term success and creativity.
Transcript:
MIKE: Hello, and welcome to another episode of the Acima Development Podcast. I'm Mike, and I'm hosting again today. With me, I have Ramses. It's just the two of us today, which is kind of nice. We'll have a conversational podcast today.
And we're going to talk about something we've actually been talking about for several weeks. We're going to be talking about how to clear your head. I'm going to share something outside of coding, as I like to do, and then bring it back to the work we do in software engineering.
There's a challenge that people do endurance athletics run into. I'm not a marathon runner, but I've heard about it most from marathon running. People talk about hitting the wall. And in a variety of sports, they talk about bonking [laughs], you know, you hit the wall and bounce off, bonk.
And I've looked into this some. There's a...in your liver, but there's also in other tissues, but particularly in your liver, your body stores glucose, you know, the simple sugar that you use for fuel for your body. And it doesn't store it directly as glucose. It makes chains like branch chains like snowflake sort of chain-on-chain structure that's easy to break apart, but also easy to store called glycogen.
And your body stores some of it so that if you have to get up and go running, you can do that, and it's great. And you can sustain exercise for a couple of hours. I was researching this earlier today to make sure I was telling the truth. I found estimates of between 80 and 100 minutes of about how long the body’s glycogen reserves stay active until you deplete them with intense exercise. You hit that point, and suddenly, your reserves, your ability to quickly take your body's energy and put it into action, basically drops off a cliff. It just stops.
It's not like you can't move necessarily because your body does have other ways. You can start breaking down fat reserves, and so on. But the easy energy is gone, right [laughs]? You hit a wall. And I’ve read about this with marathons. Well, elite marathon runners, we'll say, can finish a marathon in a little over two hours, which is crazy fast [laughs].
RAMSES: Yeah, wow.
MIKE: They're really good. But notice how that's about 120 minutes or, let’s say, 150 minutes. And the glycogen reserves, remember, last for about 100. You can see why, a lot of times, people running marathons hit a two-hour point, and they hit the wall because they haven't replenished those energy reserves, right? And so, if you just try to go...and it's tempting. You want to just go and finish, right? So, you're maybe five miles from the end. If you're an elite runner, you're probably most of the way through the race when you're hitting that line, and you think, well, I can just push through. Well, no, you can't [laughs].
RAMSES: It's deadly, yeah.
MIKE: Yeah, it just does not work. Now, like I said, I'm not a marathon runner. I do quite a bit of cycling, and I'm definitely familiar with hitting that wall. And I've hit it in other contexts, too. I remember I was working in landscaping many years ago [chuckles] and also intense physical work, right? You can deplete that blood sugar.
And I remember working a job, and my boss was out doing something else. And he'd left me and my coworker to finish up. And we had a couple of other...we were going between a few different jobs. And the one we were at was running long, but I didn't want to let my boss down. So, I said, “Well, then let's just go finish up the other job.” This would have been hours since me and my co-worker had eaten. And my thought was, I just need to get this done.
And we went there, and I was just so single-minded. I've got to get this done. Got to get this done. I wasn't really thinking about how foggy my head was getting. And [chuckles] in my rush to get things done, I was digging, and I was...I think I was just digging a hole, but it was hard. It was, like, clay-hard ground. So, I was just swinging a mattock, and the other side of the pick it's a flat bar kind of thing, digging that out, trying to break through the clay. And I hit an irrigation line, water went everywhere, and [chuckles] we didn't have the parts to fix it. And we had to go back and solve that problem.
So, I’d made the problem worse by trying to rush things through. It made the problem worse. And my coworker, she says, “If you don't get your blood sugar up, keep your blood sugar up consistently, I'm not going to work with you anymore,” and [chuckles] she was right. And we were friends, you know, this was not mean-spirited. This was just, no, that was not the right thing to do, and she was right.
I should have taken some time to get my head right. And this was pre-cell phone days, right? So, hard to call my boss, but, you know, I could have found a pay phone or something, found some way to pull this in, or maybe just gone back to the headquarters, called the customer, let them know we were going to be late because we were going to be late anyway, and finish the day. There's a number of things I should have done.
But, luckily, it wasn’t a terrible disaster. We went back the next day with some PVC and fixed the problem, and everything was okay. But I should have known better. And you get that low blood sugar, and you just can't think right. You do not think clearly. None of which has anything directly to do with software engineering, right? But when you're building software, you think. You have to think. And we're probably not doing vigorous exercise while you're doing software engineering. They’re not necessarily compatible, right [laughs]?
But your brain uses quite a bit of energy, and further, you can only sustain any activity for so long, that mental activity included. Sometimes we think, I'm just going to push through this. I just need to keep going. And you can tell your brain is slowing down, for whatever reason. There's all sorts of reasons that you can't think clearly anymore. You've got distractions. You've been focusing on it too long, and your brain just is done.
And you think, well, I'm just going to push through. I'm going to push through. And the next thing you know, you've spent way too long accomplishing nothing [laughs]. You haven't made the situation any better. You've made it worse. Or you go back, and you've written bad code. You've made a bad decision. It is critical to be attentive to those signals in your brain and know, you know, I need to do something different. Have you had similar experiences, Ramses?
RAMSES: Yeah, all the time. You're saying it's about, like, 100 minutes, 120 minutes, that's about my cap [laughter], maybe two hours on a really good stretch. But, at that point, it's, you know, you usually feel it in your back a little bit, and then usually, just have to get up. [inaudible 07:17] so I can't sit down for too long without moving a little bit. But yeah, it's really interesting. Sometimes you just...you're really close to solving the problem, but maybe you're down a dangerous hole. Yeah, it's really easy to fall into the, I'm really there, and, two hours later, you're still working on it.
MIKE: Yeah, exactly [laughs]. Exactly. And, like you said, you're just trying to push through, trying to get it done. It's hard. It's hard to catch yourself. It takes practice to recognize. There's the people who use the Pomodoro technique, named by a guy who had a kitchen timer that’s shaped like a tomato. He'd set it for an hour or a half hour, whatever the length is, turn it on. And after that timer finished, time to get up and take a break.
And forcing yourself to take a break like that sounds like you'd be disruptive, right? Like, wow, I'm never going to be able to get flow time. Like you said, that hundred minutes, you start going long enough, you're going to hit a wall, and you might not notice. You might not notice.
RAMSES: Yeah, it's really easy to just sit down for, you know, 3, 4 hours and crank away. But I think you have to, like, mentally put yourself in a good spot where you can get to a good stopping point, and even if it's not a good stopping point, you just have to get up and take a break.
MIKE: Exactly. Well, and I want to emphasize this point. To all of our listeners, we're giving you permission to take a break [laughs]. You're going to think, oh no, I need to push through it, but that's not how it works. It's okay to take a break. And we're going to talk some about what we do. What do you do, Ramses, when you need to step away from it?
RAMSES: I usually just get up and either go outside, or at least walk around for a while, move my limbs, stretch out a little bit, move my legs, just anything else, then think on the problem, usually.
MIKE: Yeah, so several things. Moving, right? Getting up off of your chair, getting your blood flowing. I don't immediately have it in front of me, but I've seen research that suggests that your brain works significantly better when you're getting some exercise.
In fact, I just saw a headline within the last week that said something along the lines that the cognitive benefits for being a weekend warrior, that is, going and doing intense physical activity on the weekend, whatever that activity might be, are lasting durable. So, even getting up and moving on the weekend can help you throughout the week. It just makes a huge difference to move, to use your body somehow.
RAMSES: Yeah, that's a great one.
MIKE: And you didn't talk about going for a run. You just said, walking around.
RAMSES: Yeah, it's usually [inaudible 10:11]. I mean, outside of the office, it's sometimes a little bit more strenuous, like a bike ride, or a jog, or something. But during the day, usually, it's just casual or light walking, a bit of socialization if I'm in the office.
MIKE: Right. And I think that's important. You don't have to go out and run a 5k, oh, you could [laughs], if that's your thing. If you're an elite runner, you could probably do that in under 20 minutes. But most typically, you're probably just going to go for a walk, go to the bathroom, say hi to somebody, and that's it, right? Just getting away from it for a few minutes is enough.
Do you find that you can read about something else, you know, go and read a news article or something you've been meaning to look at, does that work for you, or does it help for you to just nothing?
RAMSES: It sort of depends. Maybe it depends on how complex the task is that I'm working on. I sometimes find even shifting to a slightly easier or a smaller problem helps to just kind of push the big stuff away. And then, you come back to it, you know, later when I feel better.
MIKE: Yeah, I do the same thing. There'll be some trickier problem I know I need to deal with. And I will, not even fully consciously, but I will, if I'm not in the right space, I'll set that one aside for a bit and work on other things and then get back to it when I know I've got some uninterrupted time and I'm in a better headspace.
RAMSES: Yeah, it's like a sort of procrastination, but I think it's rightly justified, usually.
MIKE: Exactly. You feel bad like, oh, I'm putting this off. And I had the same thought this morning. I had a task I needed to take care of. This one was generating some data just for routine information for the auditing department. So, it's nothing bad, just grabbing some routine information. And I had to pull some data that I wasn't quite sure where it was at.
I put it off because I knew that, in that moment, it would take me longer than was justified. I worked on some other things, got through those, and then came back to it when I knew I'd have some dedicated time and spent some dedicated time for a while. And I was getting close; I was getting close to getting that. I find that doing something different is also, for me, very helpful. That way, I'm still being productive but getting into a different place in my brain so I can come back with fresher eyes.
I try to teach my kids how to deal with it when they run into mental hurdles. There's three tactics I teach them, and I'm sure there are others, but they're the ones that we found are most effective, so they're what I suggest. And they are: deep breathing, so kind of mindfulness, meditation, you know, just focus on your breathing for a bit. Get some exercise, or do something different. And we've already talked about two of those, right? Getting up, walking around a bit. It doesn't have to even be a major exercise, but getting some exercise makes a big difference.
Doing something different helps you to get your brain working on something else so you can come back with fresh eyes. So, helping them with their homework, if it's not working, we'll do one of those things. And sometimes doing something different is the right answer, and there's not shame in that. In fact, you're doing the right thing. You said, Ramses, it feels like procrastination. So, do you want to elaborate that a little bit, you know, like, where you feel like, oh, I'm putting it off and being lazy?
RAMSES: Yeah, sometimes I feel...like, sometimes I might have a hard problem I'm working on, or maybe a lengthier PR that I'm reviewing, some sort of task that takes more of my time than I'm willing to put in currently [laughs]. Sometimes I just maybe sleep on it or, especially if it's towards the end of the day, you get something, and you know it's going to take more than an hour or about an hour, and you're already kind of out of capacity, mentally at least, I find that I usually just, if I put it off until the next morning, then that's my number 1 priority. I've got fresh eyes in the morning, usually. If I treat it as my highest priority, then I know I have to get it done. I do that first.
MIKE: So, that's interesting. So, you just talked about kind of the flip side of stepping away, which is reserving your best hours for the tasks that most need them.
RAMSES: Yeah, and that's kind of hard. At least personally, I find my best hours of alertness is usually in the morning, which usually kind of coincides with meetings. But sometimes after you have lunch, I mean, afternoons, sometimes it’s pretty good. But the last hour and a half before the end of the day is usually not very good.
MIKE: So, you have 2 productivity peaks: 1 in the morning, 1 in the afternoon.
RAMSES: Pretty much.
MIKE: [laughs]
RAMSES: It depends on the task, though. Not all tasks are completely equal.
MIKE: We are not built the same as our computers, right? The computers are built to treat all tasks identical, just be a single-purpose machine that can just keep on executing instructions.
RAMSES: [inaudible 15:49] task.
MIKE: Yeah, but humans don't work that way, right?
RAMSES: No, we're very bad at multitasking, usually at least, especially on very complex problems. It's hard to keep the context in your brain on more than three or four different projects. It depends on the complexity of the project, though.
MIKE: Well, having to switch between projects, the cognitive load there and the cognitive shift always takes something. You can't just drop into something new and expect to be immediately 100% productive, even within your day, right? Even with something you worked on yesterday, it takes some time to get back into the flow state where you're deeply focused. So, there is a cost. There's a cost to switching between things. However [chuckles], there's also a cost of staying on the same thing for many hours at a time.
RAMSES: Yeah, they're probably about equal. I find if I'm on something for too long, it's usually a good sign to move on to something else.
MIKE: Yeah, usually if I get into a deep flow state, I can go for a while, and then I'll recognize I'm starting to hit a hurdle, look up, you know, it's been a couple of hours. And then I need to do something else for a while: change gears, work on something different, well, do one of the things that we've been talking about, right? We've talked about getting up, taking a break, getting some exercise. We've talked about switching gears to working on something different for a while. We haven't talked very much about deep breathing. And it's not just deep breathing although that's the most popular technique for mindfulness.
We all have to breathe, right [chuckles]? So, it's something universal to being alive as humans that we will breathe. So, it's an easy thing to pay attention to. I think it's not the breathing itself that's important but the fact that it's there, and you can pay attention to it. Because if you're paying attention to it, it's focusing on your environment rather than focusing on whatever is worrying you in the moment.
RAMSES: Right, right. It’s kind of shifting your mind away from the problem. Makes sense.
MIKE: Yeah, exactly. You can practice, right? You can practice doing that. You can practice changing that focus. And I'm not an expert practitioner of mindfulness [chuckles], but I can say some that sometimes people worry that, well, I need to focus on the breathing. And the more you try to focus on that, the more the other things come into your mind, right [chuckles]? Like, forcing yourself to try to focus on something is, like, the best way to get your mind thinking about something else [laughs]. Like, I'm not going to think about how hungry I am. Well, you're going to think about how hungry you are. That's exactly what you're going to think about [laughs].
RAMSES: That's all you're going to think about, yeah.
MIKE: Exactly. So, the trick to that mindfulness is not to necessarily be acutely aware of your breathing but rather to switch from your focus state on your problem to just being aware of your environment. Because you can practice doing that, not trying hard to focus but rather letting the stream of whatever's happening pass through your mind and just kind of being a vessel, letting it pass through.
It's actually quite similar to the flow state that you get into when you're working, when you're feeling like it's just happening, right? You don't even have to try because you're so deeply engaged. Kind of flipping to the other side of that coin and letting everything flow by you where you're not engaged is similar and restful, deeply restful. It allows you to flip that around and get back to work. And even the walking around the office is related to that in that you may not have an aim, right? You're just walking around, and [chuckles] you're making a conscious effort to not be deliberate about what happens.
RAMSES: Right. Right.
MIKE: Again, listeners, we're giving you permission to not [laughs] worry about your work for a minute because that is how we work. By disengaging from it for a period of time, you can engage better after you've had that break. And getting good at disengaging is actually a very valuable skill that will prevent that burnout that you get when you hit a wall from just trying, trying, trying, and won't let it go. So, Ramses, can you think of any times that you've been particularly good at managing your mental capacity, stepping away, getting back, and what you did to make that happen?
RAMSES: I do that quite a lot, I think. I guess I haven't really worked on any very complex problems, at least not this week.
MIKE: [chuckles]
RAMSES: In general, though, even if it's not that complex of a problem, sometimes I tend to just want to work to just burn through things, or get things done, but we all have our limits. So, after probably about two hours, it's kind of where my max is at these days. About an hour and a half, two hours is when I start feeling antsy. I'll just get up. I'll see the time; oh, okay, it's been a while.
So, I just get up, walk around, stretch out, clear myself off of that task. I also do that even if it hasn't been 2 hours. It's not, like, 2 hours and then, you know, or work for 2 hours and then take a break, work for another 2 hours, take a break. That'd be insane.
It's usually 2 hours is the max. Or I work on something; I'm at a good stopping point; I'll take a break, even if it's been, like, 20 minutes. Just take a quick, you know, minute break or whatever just before you hop into something new because that something new could take 2 hours, right? And you don't want to be stuck at a 3-hour interval.
MIKE: Right. There are natural gaps in the work that you can use to your advantage.
RAMSES: Yeah, I find that even just a one or two-minute break sometimes is good enough in between, especially shorter sessions, just because you're usually having to switch between context when you're doing either your own code, or reviewing code, or meetings, or whatever. But yeah, if I'm just taking a break, it gives you a little bit of kind of a...it re-energizes you a little bit just so then you have a little bit more mental clarity for the next task.
MIKE: Right. I find particularly after lunch, like, that post-lunch slump, maybe half an hour after lunch, is when I tend to have the hardest time with focus. And if I just do something else for 10 minutes, maybe not even work-related, like the walking around...occasionally, I'll even take a 10-minute nap [laughs]. Don't take a two-hour nap. That's not going to work.
RAMSES: Oh yeah.
MIKE: I'll set a timer for 15 minutes, lay down, and think, I wonder if I'm going to fall asleep. And the next thing I know, the timer is going off, or, actually, a lot of times, my timer doesn't even go off. It's just been 10 minutes later. I wake up, and I’m like, oh, I feel way better [laughs]. And I usually...I actually don't take a nap very often, but I do occasionally. But I will take 10 minutes of doing not work. And I sometimes feel, well, I should be more productive, then I remind myself, this works. This works. And then, I'll go back, and I'll find myself in some of my best flow state of the day for the next hour.
RAMSES: Yeah, that extra 10 minutes is certainly worth it.
MIKE: I've been thinking about times when I was definitely able to work on something for longer than a couple of hours. There was one time, quite some years ago, where I was working at a place that was growing really fast. Our traffic was growing tremendously. And our indexing solution was starting to fall apart, and it had been working. And we were running multiple instances of the index because one of them would sometimes crash, and then we'd fall back to the other one. It got to where even with running several instances at once, there was usually one down or multiple down. So [chuckles], it was not working, which was a bad situation.
So, I had to replace it with a different indexing solution. The one we were using was, like, a rewrite of the popular Lucene engine that's written in Java, and this was written in C to try to be faster, and it was; it was way faster. It was also buggy. And sometimes, it would randomly crash, and we didn't know why, and neither did the author.
And [laughs] so, I switched over to just a standard library, that [inaudible 24:29] Lucene Solr is what I was using at the time, that set up all the infrastructure and all the configuration switching over because they were minor syntax differences as well as some other things. It took me multiple days, so I didn't sleep for a couple of nights in a row [laughs]. And that was one very long day.
It's really weird when you get up in the morning, and you're seeing your second sunrise after that [laughs]. Should this be working? [laughs] I can't imagine that my brain was in the right place. And I thought, how did I make that happen? Well, it took a huge amount of mental energy to have that focus, but also, it wasn't a particularly complex problem.
I was at a small company, and I was the only one who was in the position to do it. So, the job had to get done, and somebody had to just go through all of the work to configure everything. It was kind of straightforward work that just took a lot of time. That's something that you can generally do because you don't hit that cognitive wall because you can maybe make subtle shifts in what you're doing, right? If you're starting to have a hard time focusing, work on another part of the project and keep pushing it through.
If that was a very cognitively demanding task, I couldn't possibly have done it, right? You can't imagine thinking, well, I need to solve this math proof; yeah, I'm just going to work on it [laughs] because there's some places and mental energy, some gaps you have to cross in your mind that you can't force. So, I’m thinking, well, one way that you can work through, you know, if you need to work things through a long job, you can do that if it's not that demanding. But that's different, right? That is only possible if it's not especially cognitively demanding.
RAMSES: Yeah. Yeah, that makes sense. I used to work freight a number of years ago, and I very rarely took breaks...some breaks, you know, just naturally. But it was not uncommon to work, like, 4 to 6 hours straight, just throwing freight.
MIKE: [laughs]
RAMSES: But it's not mentally taxing. It's just very physically...relatively physically.
MIKE: Right. Like the landscaping [laughs], digging holes [laughs].
RAMSES: It was mostly just cold.
MIKE: [laughs] If it's really cold, then the exercise helps [laughs].
RAMSES: It did. It was, no, it was great, fittest I've ever been [laughs].
MIKE: I’ve brought that up as an example to say, well, you know, there are some exceptions, and you just gave one as well. There are times when you can push through, but those times have very specific constraints. They kind of work around some of your mental limitations by maybe just not hitting them. If you don't have to think that hard, you can probably push further. Of course, eventually, you hit physical limitations. You need sleep. Your body needs sleep [chuckles]. You probably are going to run into muscle fatigue if you've [laughs] been doing demanding physical labor for 4 to six 6 hours. At some point, you have to stop, and there's no shame in that. It's just the constraints of the tool we have.
RAMSES: Yeah, the human...the longest anyone stayed awake for is about, like, 19 days or something.
MIKE: Was it 19 days? I thought it was less than that. I thought it was, like, 7.
RAMSES: Yeah, maybe my dates are wrong. I thought I saw something where it's, like, either 11 or 19, something just absurd.
MIKE: So, now I'm looking it up, and now you've got me curious. 11 days and 25 minutes.
RAMSES: That's...okay, wow, that's pretty insane.
MIKE: That is. I've heard...I guess there's a rare medical condition that makes it so you can't fall asleep, and it's a death sentence.
RAMSES: Yeah, that's rough. Wow.
MIKE: Luckily, very rare. That rest is necessary. It's absolutely required for life. That's a theme I really wanted to focus on today is that there is no shame. There shouldn't be any negative feelings around taking the break that you need because that's not being less effective. It's being more effective.
Cars need oil changes, right? Gas motors need oil changes. And you might think that you're using your car more effectively to not get the oil change because you're spending more time using it without doing the maintenance. And I think that that kind of thinking, I think most people would agree, is probably wrong. Because what's going to happen is you're going to destroy the vehicle so that you can't drive it at all.
If you take the time to do the regular maintenance, it does take you off the road, right? It takes the vehicle off the road, but it allows it to keep going. And with that regular maintenance, it can go for hundreds of thousands of miles. Without it, not nearly that much, right [laughs]? You might make it a few tens of thousands, and then something's going to break, and it's not going to work at all anymore.
The best use of that vehicle is going to require that regular maintenance. You can also try running it without fuel, right? Say [chuckles], “Well, I need to get down to as little fuel as possible.” And then, you miss the gas station, and you have to get your friends to push, or you get a tow. Also, not a great way to ride your vehicle.
RAMSES: No, it's not a great way to spend your evening either.
MIKE: [laughter] No, it's not.
RAMSES: I guess it makes for a good story, though.
MIKE: Right, once [laughs]. That maintenance is necessary, and it's not shameful. It's not wrong. It's the correct thing to do to get the use of your vehicle. Likewise, giving your body the maintenance that it needs: taking that break every couple of hours, getting the sleep you need.
And maybe that break can consist of a variety of things, right? Maybe you take a quick nap. Maybe you walk around the office building. Like you say, if you're home, maybe you jump on your bike and do a few laps around the neighborhood. Whatever it is that you do, we all have our different things that we do, do it because that's not avoiding work. It should be embraced because it'll make you more effective.
RAMSES: When you're stuck on a hard problem, you’ve stepped away, how do you get back into it?
MIKE: That’s interesting. Do you have any suggestions?
RAMSES: I think it depends on maybe the complexity of the problem or what you're working on. But sometimes if I'm kind of knee-deep in and it feels like you're maybe not getting anywhere or not getting where you want to be, sometimes I'll just start over or start at a...kind of backpedal a little bit, kind of re-approach the problem in a different way, and I find that sometimes works.
MIKE: When you asked that question, you got me thinking about it, and I came to almost the same answer. I find that what's very helpful, for me, is to go back kind of to the beginning, or a few steps back, and recheck my assumptions. Did I make the right choice at this fork in the road, right? Are my assumptions correct here? Are my assumptions correct here? Are my assumptions correct here? And work my way down. And, generally, when I effectively solve the problem, I'll find the spot where, well, you know what? I made some assumptions here, and maybe they weren't right. And [laughs] it's hard to see that when you're deep down in it and depending on those assumptions.
RAMSES: Yeah, it's really tricky if you got, like, 30 file changes and 500 lines of code. And you're like, okay [laughs], where did we go wrong?
MIKE: [laughs] Yeah, and maybe rebuilding part of it, doing it again makes more sense. A lot of times, the hard problems, the most cognitively demanding problems, for me, are debugging because you have to figure out the context. You have to figure out where the problem is, and a lot of times, it's not your own code, right? It's somebody else's. Rarely is it all your own, right? You're working in something bigger.
And having to understand where you're at in that problem and figure out the assumptions along the way is very demanding. And [laughs] it's easy to miss something somewhere. And sometimes you'll find out...I’ve probably talked about this in other podcasts, but several times, I can think of getting to a point where I thought, well, this is impossible. This is absolutely not possible. And when I think that, I've learned to step back and say, “You're right. It is impossible for this to happen, given the assumptions that I have made. And if that's so, then it means not that the problem is hard but that my assumptions are wrong.”
RAMSES: Yeah, yeah, that makes sense. Yeah, it's just ignorance, right? We just don't know what we don't know.
MIKE: Yeah, and then stepping back and saying, “Well, if this is impossible for it to be happening, then that means that some of my, whatever it is, my assumption is wrong.” The hardest debugging problem I had that I can think of took me a month.
RAMSES: Whoa.
MIKE: Yeah, and multiple times. So, I was using a new library. It was actually a library that's going to be deprecated soon, TikiTorch, which you've probably used.
RAMSES: No.
MIKE: [chuckles] It was a library that was brand new at the time, and it does asynchronous messaging between applications. So, you're dealing with a cross-application problem, so it's a distributed system, and it's multi-threaded on both ends. So, it's concurrent on both ends, and there's no guaranteed order of operations because you have different threads that can launch at different times. So, you're dealing with both concurrency and a distributed concurrent system [laughter].
And twice, I was trying to figure out why it wasn't working. We were getting messages that weren't getting through. And we were also having high memory usage and trying to figure out why. So, it was a long time ago, so I don't remember all of it. But I remember that the way we were using the library was wrong. We were firing off a new thread every time we used it, rather than relying on existing thread, which was bad.
RAMSES: Wow.
MIKE: That's where the excessive usage came from. So, our usage of the library was wrong, which was firing off a bunch of threads, which was slowing down the app. And then, two other places in the code, I thought, this isn't possible. This can't possibly be happening. I had to step back, and I thought, well, if this isn't possible, is the library broken? And it was [laughter].
So, I found two bugs in the library. And the library had been fairly thoroughly tested, but there were a couple of edge cases that got missed, and there were bugs in them. And [laughs] if you reach something that's impossible, if you can prove that you're...you say, "Well, my code can't possibly be wrong," take a step back. Well, maybe that's true. But that doesn't mean that the system underneath it is, right? And that's a hard jump to make because you usually trust the libraries that you're using, right? That's kind of the standard practice. At some point, you've got to trust the system, that the system's going to work if it could just do what you tell it to do. But sometimes, the library's wrong.
I remember my very first full-time development job, we were working with a database adapter that, if you passed it a null character, it would break the connection.
RAMSES: Wow.
MIKE: And our connection would sometimes break, and we didn't know why. And it turned out to just be if somebody accidentally put a strange control character in their input, it was killing our database connection [laughter]. It was a problem in the adapter. My manager I was working with at the time submitted a patch to the maintainers of the library, and they got it applied.
RAMSES: Wow, nice.
MIKE: Yeah, yeah. It was nice. Sometimes, it's the library, which was kind of a long tangent. I grabbed your tangent and ran with it [laughs]. How do you get back into it? Well, a lot of it is going back, right? Going back a few steps and exploring it in a different way for me. For me, a lot of it is challenging my assumptions because usually, where I go wrong, it's because my assumptions are wrong somewhere.
RAMSES: Yeah, yeah, that makes sense. Yeah, it's really easy to have wrong assumptions sometimes based on what you know or what you don't know.
MIKE: Exactly. It’s like the ignorance you were mentioning before. There's no shame in ignorance as long as you're working on it [laughs] because we all have most things that we're ignorant of. And we're going through the process of undoing that a little bit.
RAMSES: Yeah, I think I'm ignorant of most things, which isn't bad.
MIKE: Yeah, no, in an incomprehensibly large universe, we couldn't help but be ignorant of most things.
RAMSES: Yeah, right, right, yeah.
MIKE: Thank you, Ramses. This has been great.
RAMSES: Yeah, this was great.
MIKE: Hopefully, listeners, you've gotten some ideas as to how to manage your day to be more effective by taking some time to be less so, taking some time to do something different than the work you're on so that you can give your brain a chance to rebuild its reserves.
And with that, thank you. Until next time on the Acima Development Podcast.