# The struggle within ## The emotions of programming There's a stereotype of a programmer sitting emotionless in front of the computer entering lines of code as though they were just transcribing them from memory. But if you've been around programmers you know that it's more like the stereotype of the frustrated composer. We bask in the glories of code that works perfectly the first time. We glower at code that misbehaves. We go from cheering ourselves in victory to cursing the machine with clenched fists. We swing from emotion to emotion: exuberance, joy, fear, anger, resentment, sadness, loneliness, guilt, and shame. No wonder we're exhausted by the end of the day. Programming is a taxing process. Not only do we need to keep a mental model of the software we're working on, but we also have our emotional attachment the software. Our emotional state can mirror what we feel about what we're creating; whether we're excited, bored, or stuck. Keeping a positive attitude about software that isn't measuring up to our expectations is exhausting. Couple that with our own insecurities, fears, and doubts and you begin to see why programmers tend to burn out - it's a combination of the stress of the job and our emotional reaction to that stress. ## Emotional drains There are several factors that can cause us emotional highs and lows. These are some that I've noticed in my own programming. ### Purpose and utility If we clearly see where this code will become useful we can get a sense of drive and purpose. We're working toward something that will benefit folks! Whatever pitfalls lie in wait for us we can be assured that we will do our best to make sure that we conquer them as best we can because people are depending on us. We can tap into the emotional high of self-worth and purpose to help buoy us along. The opposite is true, of course. If we don't see the purpose then our work will seem in vain. We'll struggle to meet deadlines and feel a sense of worthlessness in our pursuits. Sometimes it's just a bad project, or it's a project that isn't aligned with our underlying purposes and goals. We can be frustrated trying to meet some arbitrary deadline if we don't see the point of what we're working on. ### Engagement vs. boredom You've already experienced several layers of engagement with your programming. There are projects and topics that don't feel like a chore. You feel like you're learning something each step of the way. Time disappears. Conversely you've likely experienced the opposite: boredom. The code base doesn't engage you at all. The topic being covered is just re-hashing something you already know. It's a chore to get started and the minutes drag along throughout the whole process. ### Awake vs. tired Sleep is a major contributor to how we perceive the world. Getting enough sleep manifests in feeling refreshed, awake, and inspired. We have the energy reserves at the ready to take on whatever challenges befall us. But when we don't get enough sleep (or enough quality sleep) we become irritable and less-open to engagement. We conserve our resources as best we can lest we use them up too quickly. ### Mental state I'm using "mental state" in a broad sense to cover any of our existing feelings and current mental well-being. These can range from temporary feelings of unhappiness and melancholy to complex topics like clinical depression and PTSD. Our minds are complex machines that do their best to adapt to the situations and environment presented to them. At times this can clash with our desires to be productive and the struggle between our mental state and our desires can cause further emotional drain, discomfort, and despair. There are more things that can affect our emotions but these are the ones that I'd like to focus on as they cover a broad spectrum of what we bring to the tasks of learning and programming. ## Awareness of our Emotional State Being aware of our emotional state (what we're feeling right now) gives us our current emotional location. We can see where we are and understand what our mind is telling us. Giving ourselves a few moments to truly see what emotional state our mind is in will help us to move forward. Note that we're not trying to change our emotional state. We're not trying to force ourselves to be something we're not. If we're truly unhappy with where we are or what we're doing it's more helpful to see what's causing this unhappiness than to try to paper over those emotions. Seeing our emotions clearly allows us to see what is causing them. Being present with these emotions allows us to better understand our mental state and what we're capable of in the moment. You can do this in the context of mindfulness meditation but even sitting still in your desk and saying "for one to two minutes I'm just going to sit here and explore my emotional state" should suffice. Seeing our emotions for what they are and thinking to what is causing them can help us understand what we're feeling. ## Our story Each one of us have a story that we tell ourselves. The stories we tell ourselves shape our perception of the world. We tell ourselves stories of how the day will be, and how we will engage with the day. We create a world in which we are the central protagonist of our story (which we are). We tell ourselves stories like "the work I'm about to do will be amazing" or "I'm going to work through this problem quickly and will have an awesome solution when I'm done". Or we tell ourselves a story about how we're not good at what we're doing and will likely fail in the attempt. We weave a tale of struggle, pain, and misery. Our emotions inform the story we tell. If we're feeling amazing we tell ourselves that what lies ahead will also be amazing. If we're feeling down and defeated our story reflects that. The story is just that - a story. Our stories are not a guarantee of how the day will progress. We can tell ourselves that today will be amazing but watch in horror as each interaction we have causes that story to reflect a different reality. Or we can say that today will totally suck and we won't accomplish anything but instead have a pretty decent day. What we can do instead of creating these grand stories is focus more on the things that we love about the present moment. Instead of saying that we're going to have an amazing day we can say that there are things that we are looking forward to in this project and we hope to work on them. Instead of filling your day with dread you can focus on the little victories along the way. Yes, even something as small as "my computer booted without crashing" can be a victory. Giving ourselves the power to focus more on the present and the very next steps we're about to take gives us the freedom to recalibrate as the day progresses. We can focus on the positive aspects of what we're doing instead of seeing how reality is diverging from our internal stories. ## Awareness in action Say in this moment that we're feeling anxious. We've just received a bug report and it's related to something we're working on. The bug report states that code that we committed earlier isn't working and probably has never worked the way we thought it worked. As we read the bug report our anxiety levels increase. Our inner monologue kicks in and we start telling ourselves that we aren't nearly as good as we thought. We're not perfect. We suck. We didn't get enough sleep the night before so our emotions are in a state of heightened awareness. Our mind races to the other times when we've failed. As we keep reading our sense of dread kicks in. What will they think of me? What do they think of me now? Am I going to lose my job over this? Before we've even finished the bug report we've created a story where we can only think of our past failures. Worse, we've already added this one to the list of failures. We also added to the stakes of this bug report. Not only do we have to fix whatever broke but now we have to fix our reputation and start a job search. The story we've created isn't a good story, but I'm sure you can relate to it. You've had this story play out in your head. It's a story based on our insecurities and feelings of inadequacy. It's fueled by a feeling of fear: fear that you'll ruin your reputation, fear they won't trust you, and fear that you'll fail. Fear is one of the most powerful emotions we have but it's not the only one. Reading that bug report may also elicit other emotions like grief (we thought that code was good and now that thought is gone), uncertainty (how will we fix the problem?), and anger (how could we have deluded ourselves into thinking this worked?). We may also feel sadness and loneliness. We could feel disconnected and adrift. Being aware of the feelings we have can help us diagnose the story we told ourselves and how it didn't match reality. They can give us feedback on how we are perceiving our world and the work we're doing. Pausing for a moment to acknowledge our feelings and understand where they are coming from give us an understanding of what our emotions are trying to tell us. ## Finding our feelings Our feelings manifest themselves in our bodies in some shape or form. Fear can be a knot in our stomach or tension in our chest. Anger can feel like our head is getting hot and our jaw clenching. We can pause for a moment and just sit with our feelings and notice them. Think of like you are scanning your body looking for the feelings you have. Notice where your mind is drawn: tightness of your chest, tightness in your stomach, a clenched jaw, or whatever you may feel. Notice the sensation of that feeling. You can dig deeper and try to find the underlying causes of the feeling but for now just notice that it exists. Sit for a few moments more and be curious about how it feels. Let the feeling exist - be kind and gentle with it. Give it space. Above all don't try to fight the feeling or wish that it would end; just notice it. Eventually the feeling may subside but for now just acknowledge that you have this feeling and you're going to be curious about it. Some feelings and emotions may be more painful than others. Give them space and be curious about them as long as you can. If you notice yourself starting to panic or feel overwhelmed by the feeling then you may stop before they overtake you. Remind yourself that these are emotions and are a part of you. You and your emotions work together. You're on the same team. ## Emotional Triage There's a tendency to want to run away from our feelings, or try to suppress them. Our feelings aren't always pleasant and we want to avoid things that make us unhappy or uncomfortable. And we want our internal narrative to be one of someone who is smart and capable of doing anything we put our mind to doing. But when we feel negative emotions or fail to live up to our stories we start to feel crappy about ourselves. We wonder if this is worth it and wonder if we will ever be happy working with computers. Think of this practice as emotional triage. Hopefully you've never had to go to a hospital emergency room, but if you have you'll see a whole string of doctors and nurses who are trained to diagnose what just walked through the door and determine the severity of the problem. When we recognize that we're having an emotion we too are diagnosing what emotion we're having and the severity of the emotion. We take these moments when we're having these emotions to see what the emotion is. As we review our emotions we are gentle with them and see them for what they are. A good doctor or nurse doesn't impose their desires on the patient; the simply accept the patient for who they are and act accordingly. When we recognize our emotions for what they are and see where they are coming from we can better understand what we're facing. The more we do this practice the better we'll become at recognizing our emotions and why we're having them. We'll be better able to see what we're feeling and understand why we're feeling them. When we feel anxious we can recognize that we might be in an area of development where we don't fully know what we're doing. We can then feel the anxiety for a bit (don't try to chase it away just yet) and then think about what we're currently working on and the areas that might be new to us. We can then mentally note them, or (better still) write them down or journal them so when we complete what we're doing we can review the areas that caused us anxiety. With this practice we can turn our emotions from something that drives us into something that guides us. We can use our emotions as a tool to better calibrate our internal stories. Instead of thinking that we're going to be amazing programmers generating bug-free code (which is amazing fiction, no doubt) we can instead say that we're going to spend the next 10 minutes exploring this area of our work and see where the gaps are in there. As we explore our emotions and anxiety can let us know where we feel we need to improve and adapt. We can then change our plans as needed to address those areas we feel are lacking or need improvement. ## Burnout One thing that our emotional triage can help us diagnose is feeling burned out. Burnout is a collection of emotions coupled with emotional and physical exhaustion. Burnout can manifest itself in different ways. For some it may be the feeling of dread for working on a project. They feel like they are ineffectual in making any changes. For others burnout can be feelings of exhaustion. They feel as though they're on a treadmill that just will not stop and they wanted to stop a long time ago. Burnout can also manifest in feeling creatively drained, where imagining a different future is difficult and nothing that you do is interesting. Burnout can be something as simple as boredom or being overworked but it can also be the sign of something more serious. Burnout can lead to physical complications if we're not careful. We can work ourselves to exhaustion and think that's just part of the price we have to pay as programmers. Burnout is tricky to self-diagnose because it is a collection of seemingly unrelated emotions. Our feelings of boredom, fear, exhaustion, and anxiety can all have different root causes, but when we couple them together with unrelenting working schedules we amplify them. Left unchecked and unexamined we can lead ourselves into places where we don't want to program anymore. We can cause ourselves more undue suffering by just "powering through it" which can lead us to compound our emotional state. There are some things we can do to understand and help alleviate burnout: 1. Realize that we're burned out, or about to burn out. Acknowledging that we're about to burn out is key to not experiencing the burnout. That seems simple enough but we tend to realize it when we're in it. If we can recognize that we're about to burn out then we can take measures to avoid it. And if we realize that we've burned out we can take measures to be kind to ourselves and help ourselves out of this burned-out state. 1. Examine our emotions. Sit for a while and see what emotions come into view. Are we feeling stress, fear, anxiety, nervousness, or anger? See what feelings emerge and recognize these feelings. Examine where these feelings are coming from and what might be triggering these emotions. 1. Re-negotiate our commitments. Many times burnout is the result of overcommitment, whether to others or ourselves. We have too much to do and despite our best efforts we can't meet the obligations. Perhaps they were too aggressive, or something caused the world to change when the plan was made. Whatever the reason we may need to re-evaluate what is expected of us and what we are capable of doing. And if we see that we've created an intractable situation for ourselves then we need to figure out how to cut away some of these obligations. 1. Give our drive a rest. Unlike our mechanical counterparts we need downtime and rest. We can't work a straight 8 hours without at least some moments where we aren't working. Programming demands a lot of mental bandwidth and pushing ourselves to exhaustion can lead to emotional instability, stress, and burnout. 1. Examine if this is truly how we want to live our lives. We need to be aware if what we're doing is really what we want to be doing. If we're not happy doing this then every moment we do this can compound our feelings of unhappiness. If we look deep in ourselves and feel nothing but dread for our current situation then we may need to renegotiate our commitments. That can be something as simple as agreeing not to learn something right now, or can be as complex as taking on different work or changing careers. By understanding that we're headed toward burnout (or are burned-out already) we can take measures to course-correct so we can approach our programming practice with joy and enthusiasm. Sometimes taking a step back and re-evaluating what we're doing can help us not sit in the constant loops of frustration, anger, and guilt. Changing our story to better fit reality can keep us from trying to match an impossible dream. You will experience burnout in your programming career. Things will come at you that will overwhelm your ability to cope with them. You will find yourself stuck in loops wondering if this is really what you should be doing. Understanding what you're feeling and acknowledging your feelings as valid is the first step to changing the course from one of burnout and stress. Programming shouldn't be drudgery (no work should be drudgery). There should be something in your programming day that keeps you motivated, and helps you grow your skills. Adding bits of learning, joy and wonder (along with periods of downtime) will help sustain you through the emotional turbulence that awaits. ## Giving up Programmers don't like to think about giving up. We work on machines that have so many possibilities that we feel we should be able to make things work. But sometimes we can't see those possibilities. Sometimes we look at the list of things we should be learning and wonder if it's all worth it. We look at lists of job prospects and see nothing but meaningless work. Students ask us what it's like to be a programmer and we wonder if it's OK to crush their dreams this early in their careers. The joy that sustained us into learning the craft disappears and we're left wondering if we will ever cultivate that feeling again. Programming isn't for everyone. There are times when I've wondered if I should be working as a programmer. I feel as though I can't learn everything that I need to know, and wonder if what I'm learning will not matter because in 10 seconds everything out there will have completely changed. I struggle looking at job positions that seem like they won't matter in 3 years, let alone 100. I feel like the computing future I was promised never happened and we're stuck in a world where computers are little more than levers for companies to pry open the wallets of their customers. It's easy to become fatalistic about the practice of programming but I've realized that there's more to computing and programming than what I see in the job market. (Discuss the world of computer science, and curiosity)