The Valuable Dev

6 Sources of Stress in Software Development

a conference on JavaScript can be quite stressful

I remember it vividly: I was lying on my bed, cold and shaking. The room was turning. I was dizzy, angry, sad, full or reproaches, mostly toward myself. My nerves were breaking, my body was reacting.

I couldn’t move anymore.

It was 10 years ago, a Friday, late in the evening, after coming back from work. Working from 8am to midnight was no exception. I was working in a very small web agency as a beginner web developer, without any prior professional experience. I knew how to code (I was coding as a hobby for 10 years already) but I never experienced this kind of pressure.

I had one of my biggest panic attack because my CEO announced me, just before going two weeks in holidays, that he might fire me. The reason: I was “too slow” and “not productive enough”. The conclusion was simple: he “regretted hiring me”. No further explanations given.

My situation was precarious at that time and losing my job would have been disastrous.

After 30 to 40 minutes on my bed which felt like an eternity, I managed to calm down. I needed to prove to my boss that I was valuable. I worked all week-end and crazy hours during the next two weeks to show my worth. Who cares about health?

I managed to stay one year in this company, enough to have the experience necessary to find something better. When it went bankrupt, the CEO told me that I was the best employee. Go figure.

I was totally burned out: my self-confidence was destroyed, my mental and physical tiredness were the highest I’ve ever experienced. I was disillusioned, empty, drained.

This is the consequences of stress: subtle physical reactions which can take massive proportions, affecting your whole body as well as your fragile mental health. I had to cope with stress for every company I worked for, and each time I was managing it better and better.

That’s why I would like to share what I learned with you. Our health is more important than anything else. You need to preserve it, nurture it, not necessarily to live longer, but to live better.

Now, compared to this dark period of my life, I feel way, way better. What happened? Did I find better companies to work with? Sometimes, but the changes were mostly the result of trying to understand how my brain work.

In this article we’ll try to understand stress from different perspectives. More precisely, we’ll talk about:

  • The origin of stress: why are we stressed at the first place?
  • The consequences of being constantly stressed.
  • 6 possible sources of stress and how to manage them.

Let’s now begin our descent in the Dungeon of Fear, where the horrible Monster of Stress is waiting for our punishment.

What is Stress?

To understand how we can decrease our stress, we need first to define what we’re trying to decrease. Where does stress come from?

Welcome to the Savanna!

Darth Vader stressing developer on a dinosaur

Let’s imagine together the following scene: you’re in the Savanna with nothing except a dull knife made out of stone. It was a present from your mother-in-law. You’re still not sure if it was an attempt to help you or to kill you.

You’re out in the wild because you need to bring some food to your family, waiting in a sumptuous and well decorated cave. It’s not easy, supermarkets and mass production were not yet invented. You need to put your life at risk to be able to eat and survive.

Suddenly, you understand that a terrible lioness is observing you, hidden in the bushes. She’s hunting, and it seems obvious that you’re the pray. How ironic, to finish as a meal when you’re desperately trying to find one. Ah! The cycle of life!

But you don’t have the pleasure to think about the wonder of nature and other philosophical considerations. Instead, your brain shuts down. All the emotions and legitimate questions you had earlier had been replaced by fear. Your heart begins to work harder, your blood pour in your muscles, your breath becomes shorter.

Without even thinking about what you’re doing, your legs begin to move. You start the sprint of your life, desperately trying to escape the predator.

Congratulations! You just experienced a high level of stress: a very complex mechanism which allows us to survive in life threatening situations. It’s the famous fight or flight response, and both will require you to use your muscles more than anything else.

The Modern Savanna

Nowadays, it’s not very likely to meet a lioness in the middle of nowhere, at least not where I’m living. But this stress mechanism can still save your life: if a car rush at you, you will be happy to quickly jump on the side without even beginning to think about it.

This is the benefit of stress, but it has drawbacks too. We have difficulties to distinguish real threatening situations and more casual scenarios with less impact. Crossing a lioness in the middle of the street can be as stressful as giving a presentation in the front of an audience.

Let’s imagine that you’ve given this presentation and you failed horribly. What could be the consequences?

  1. You lose your credibility.
  2. You lose your job.
  3. You lose your family because your partner doesn’t like your weak presentation skills.
  4. You lose your house after beginning gambling, drinking, and using drugs.
  5. You end up in the street.
  6. It’s winter and cold, sleeping in the street could be a life threatening situation.

It looks ridiculous to bring a life-threatening situation as a result of a more mundane scenario. Yet, we’re still stressed about it. Are these worries really existing? Is it only in our head?

Because it’s “only in our head”, some will consider stress very lightly, like it’s not “really” a problem. But what’s in “our head” is very real to us, and can have disastrous consequences. You could even argue that most of our reality is in our head.

Speaking about stress...
If you want to step up your soft skills, you might be interested by the book I’m writing.

The Consequences of Being Stressed

If you’re curious, I would definitely recommend the fantastic book Why Zebras Don’t Get Ulcers by Robert M. Sapolsky. It’s well explained, funny, and you’ll dive deep into the mechanisms of stress and their consequences. This part is heavily inspired by his work.

Short Term Stress: Fight or Flight?

Let’s go back to you, unlucky hunter in the Savanna, with your best friend the lioness. What happens, in your body, when you realise that your life is in danger?

  1. When your brain think that there is a stressful situation, it will release some specific hormones, creating a chain reaction.
  2. Because you need energy, your heart will work harder. Therefore, your blood pressure will raise.
  3. More fat and glucose (sugar) will be present in your blood: your muscles need energy for you to run fast.
  4. No energy is given to your reproductive system anymore. You don’t want to reproduce yourself when your life is at stake, do you?
  5. The whole immune system is too costly. That’s why it shuts down. The threat is the lioness, not a virus.
  6. Your memory is enhanced! After all, if you can go away from the lioness, you need to remember it, in case your mother-in-law decide to throw you in front of one.

Now, let’s imagine that you need to go to work every day:

  • Your management is pretty impatient for you to ship the new awesome-feature-which-will-disrupt-the-market.
  • You have bugs popping out of nowhere and they need to be solved immediately.
  • Dave, your colleague developer, is trying to climb the hierarchical ladder by proving to your boss that he’s better than you.
  • You struggle to focus between the 489 Slack channels.

When you come back home, you’re still trying to write some article for your technical blog, feeding up your GitHub account with well crafted code, read articles about the last trends to stay up-to-date and employable.

There are no life threatening situations here: if you make mistakes at work, if you don’t have a blog, or if your GitHub account is empty, I’m pretty sure you’ll survive. Still, these are stressful situations, and, more importantly, they are not short term anymore.

Anxiety and Chronic Stress: The Sickness of the Modern World

modern stress

What happens when you’re stressed not only when you see a lioness, but most of the time?

  1. Your blood vessels will get stronger in order to regulate the high blood pressure.
  2. More blood pressure will be needed to balance the regulation.
  3. The vicious circle of blood pressure will cause blood vessel inflammations.
  4. The cholesterol and fat, more abundant in your blood, has a tendency to stick to blood vessel inflammations.
  5. This fat can eventually block your blood vessels. This is how you have strokes and heart attacks.

Doesn’t sound too good, does it? The truth is: it’s only the top of the iceberg:

  • Your immune system will be constantly low. This is good news for every virus and bacteria trying to arm you.
  • Your memory won’t be enhanced anymore. Long term stress will disrupt the whole memory mechanism for you not to remember things.
  • If you’re a man, you might have sexual problems of any kind.
  • It has been shown that there are important links between depression and chronic stress.
  • Stress is the first responsible for insomnia. If you’re still able to sleep, you won’t sleep well. Difficult to restore your energy in that case.
  • A lack of energy will cause more stress response.

What about the myth of the “good stress”? Did you hear one of your manager, or even your colleague developers, speaking about the “good stress which will makes you more productive and push you to finish your tasks”? I surely did.

I often ask this question: how do you know what kind of stress you’re doing? How do you know is it the “good” kind? How do you control it?

How managers, who want their features as soon as possible, possibly know how to give the “good” stress without the “bad” one? How developers, who wants to finish their side projects and become rich, can control their “good stress” without being exhausted or even burned out?

Life will throw stress at us without the need of to create it for the greater good. Don’t do that to the others or to yourself.

Now that we clarified what’s stress and why we should avoid it, let’s see how to manage it in the field of software development.

6 Important Sources of Stress: Problems and Solutions

One of the main problem with stress: we don’t necessarily realise that it’s poisoning our lives. If we’re too busy, we might fail to feel our body overreacting. We are often accustomed to stress, accepting it as the new normal.

That’s why it’s important to know what thoughts, assumptions, beliefs, or actions can cause stress for a software developer. Don’t forget that everybody is different: try to recognize the situation causing the most stress for you.

Here’s a non-exhaustive list of possible sources of stress I find the most problematic.

1. The Stress of the Deadlines

The Problem

When we speak about stress, deadlines are the elephants in the room.

“Of course we need some deadlines!” would say your manager, or even Dave, your colleague developer. Everybody agrees, deadlines are necessary, otherwise nothing would never be done.

The real question is: how to determine accurately a deadline, given a precise task? This question alone will bring many problems:

  • How to know precisely how long a task will take?
  • Should the deadlines be fixed in stone, forcing every developer to respect it, whatever the cost?
  • Should deadlines be used to pressure developers for them to do their work?

A deadline can be a tool. Like a hammer, it can be useful: it can give you an rough idea when the task might be finished, even if there are big chances you’re wrong. If you know that, then deadlines can indeed help you forecast your future to some degrees.

Like a hammer, it can be used as a weapon as well in order to pressure everybody.

Can you predict the future? Do you know how long a task will take, knowing that software development is a complex mix of hundred of tiny details nobody can comprehend at once? Can anybody gives an exact period of time to finish a complex task?

The Possible Solutions

No Deadlines

One of the solution would be to remove deadlines. The task is done when it’s done. You can still give some estimations, if everybody agrees that they are not fixed in stone.

It’s not a dream. I saw it working effectively in real companies.

If the management of a company trust their employees, they understand that the developers will do their best to get their tasks done and provide as much value as they can. Good developers like what they’re doing, and therefore want to create positive outcomes with their work. They’ll be empowered by the fact that they don’t have hard deadline. This is a virtuous circle.

If the management assume that it’s necessary to put a lot of pressure because “otherwise developers won’t work as much”, it’s admitting that the company’s hiring process is wrong. They hired the wrong kind of people. This should be fixed, instead of pressuring everybody.

You should use these arguments to your management to make estimations instead of deadline and to define them as hypothetical version of the future. Explain to them how much can cause stress.

If they don’t want to listen, find another job. There are companies out there which understand all of that.

Continuous Delivery

If a company deliver small features very often, developers won’t have to suffer short or unrealistic deadlines for the next big features. The book Accelerate: The Science Behind Devops describe very well why top performers (measured by the companies’ market shares and profitability) seem to use continuous delivery to their advantages.

If your managers argue that every feature they ship need to be big (and therefore hard to estimate), you can always turn it around and show how a big feature can be divided into small chunks.

We often think that a big feature will please even more than a small one: the idea of “big” is often linked to the idea of “impressive” in our mind. But it’s also a good way to develop functionalities for months without being sure that the end users really want the implementation we provide.

The UI could be awful for them, or there could be misunderstandings about what they really need. Delivering and receiving feedback often is an effective way to know if your features are headed in the good direction.

Calibration Tests

Finally, if you want to improve how to measure your estimations, calibration tests can be pretty useful. By default, people have tendency to be optimistic in any estimation they make. Calibrating yourself could help to be more realistic. Again, to some extent.

Calibration tests and, more precisely, the general idea of measuring is very well described in the great book How to Measure Anything, which can help you measure what’s important with probabilistic approaches.

2. Lost in the Technology Twister

stress as a software developer mixing knowledge

The Problem

Technologies evolve at a speed we can’t really control: a new framework pops up every day, new CSS properties appear, new tools and other trendy noise emerge. Difficult to know what to learn, how to learn it, and what to use in what situation.

Developers can easily be under a lot of chronic stress if they try to read every single newsletter out there about all these technologies, trying to keep track of their dozen of RSS feeds and hundreds of daily articles, trying to be up to date about everything.

The Possible Solutions

Did you hear about the first principles? If you know enough about the basis, the foundations of this noisy technological twister, you won’t have to learn actively every single trend popping up. Indeed, you will be able to adapt quickly if you have to work with them.

What do I mean by the first principles? The general knowledge common to every new language, framework, build tool, and whatnot. This is one of the mission of this blog: helping you to acquire these building blocks.

You shouldn’t try to learn deeply or master everything out there, a rough idea about the last frameworks and tools should be enough. What’s important is your adapting skills to every possible technology thrown at you.

The good news: these first principles barely change over the years. We are still using functional or object-oriented programming for example, for decades. Good practices are always the same despite a lot of ongoing debates. The “new” technologies you hear about here and there are mostly old concepts with a new name.

Don’t try to learn everything at once but consistently, one step at a time, on a regular basis.

3. Intense Competition

The Problem

We are millions of developers out there, competing on the same technical skills to get the job of our dream. We are very proud to put on our resumes the programming languages we know (and the one we think we know), surrounded by one, two, three, four or five little stars, to show how efficient we are with them.

We show to the world our projects with pride on GitHub, to prove how much better we are from the “average developer”, whatever it means.

When we send our resumes, we expect companies to be illuminated by the depth of our knowledge, the speed of our typing, the efficiency we have to ship complicated feature. We are doing hackaton, we train for the silly tests many companies will ask us to complete to get a job. They want to be sure that we’re the providential 10x developer.

We are on Hacker Rank to see who’s the best, who has the biggest brain, using flawed and subjective gamification mechanisms. We’re all become FizzBuzz evangelists.

This competitive behavior can be very stressful. How do you know how good you are compared to the others? Because you have more stars on Github? Because you did 10 years of Computer Science at MIT? A lot of doubts and questions can arise with many wrong answers.

These thoughts can haunt your days and nights, imposing to your body and your mind a constant stress.

The Possible Solutions

Adapting to the Company’s Needs

First things first, being the best technical developer is overrated. Let me explain: a company should not really care if you can find a way to compute the pascal triangle in O(n) time, but they should care if you can answer their specific business needs and solve their business problems.

Every company has a specific business model, and, as a developer, your job is to add value to this company by automating things. By codifying solutions to their business problems in your codebase.

We should stop competing with the whole world: show to the companies you want to work with how you can solve their specific problems, in concrete ways. If you have enough experience, show them how you did it in the past. Explain why you know their specific business domain.

Show them that you know the basics of your “craft” and, therefore, that you can adapt very quickly to many technologies and business models. Show them that you can automate their process.

If you are rejected because you can’t pass their coding tests (which has nothing to do, most of the time, with the day-to-day work in the same company), change your strategy and try to find a company which can answer your need.

Another strategy: try to bypass the lower managers and the human resources with their silly technical tests. Make friends, and not only developers: entrepreneurs have many problems you can solve. Go hanging out where they hang out.

Beating the Concurrence

Being generalist is not a very good idea to beat the concurrence when you search a job, simply because the majority of developers out there are generalists.

You know what occurs when you try to compete with the whole world on the same positioning? A cheer amount of stress. It’s even more true with the possibility to do remote job, and, therefore, to compete with many more developers on a larger geographical scale.

Try to narrow down what you are very good at: find yourself a speciality, something useful to solve people’s problems. You could be specialised in APIs, for example, or into e-commerce logistic softwares.

You will then appear as an expert, compared to the guy who can code in PHP, Javascript, Java, Python, CSS, C++, can fix the kitchen sink, and do wonderful coffees. In business, nobody likes the jack-of-all-trades.

Finding a specialty can be very difficult. It won’t happen from one day to another. You need to keep your ears open, see what problems company and individuals have they can’t solve, and try to bring specific solutions. Being a specialist doesn’t mean that you will stay all your life in a boring niche: it’s mainly about how you speak about yourself. How you position yourself on the market. It’s not about you intrinsically.

Another idea: trying to develop skills that developers generally lack. For example, soft skills like communication or a good understanding of marketing. It’s difficult to sell, but it will help you tremendously in your daily job.

We are more than code monkeys, we’re good problem solvers, and solving problems doesn’t always require code.

4. Legacy Applications

The Problem

Each time you open the application you’re working on, fear grow suddenly in your heart. Cold sweat appears on your forehead. Your hands are shacking.

Your legacy application has been “maintained” for years by dozen of developers who ran away, a long time ago. They couldn’t cope with the growing complexity and the technical debt piling on, and on, and on. It takes days, sometimes week, to implement simple features.

Each try is the equivalent of a dive into the abyss: you never know what will break, what random bug will pop up, what surprise is lurking on you, ready to show itself when everything is pushed on the production server.

Additionally, you have no clue what’s the purpose of some parts of the application: the documentation has never been written, the specifications lost in the Pit of Forgotten Specifications™.

I don’t know about you, but only writing these lines stresses me.

The Possible Solutions

You might think that rewriting the whole “thing” from scratch would be the perfect solution, but it can be a very dangerous one as well. Your management might not allow it for very good reasons: it’s expensive and it could block many developers for months.

Also, if you have no clue why the application ended up that way, you might do exactly the same mistakes while rewriting it. In short, you’ll end up with a legacy application. Not really effective, is it?

What happened? The developers might have had crazy deadlines, a problem which is more about the company culture and still not solved? Maybe nobody really knew what problem the application was supposed to answer, letting the developers implementing more or less what they wanted?

Gerald Weinberg totally nails it in his book The Secrets Of Consulting:

If you use the same recipe, you get the same bread.

To avoid following the same recipe, you need to know what recipe lead to the disaster you need to maintain. In other words, you need to know how to avoid reproducing the same mistakes. That’s why a total rewriting can be a very risky task.

Instead, I would go for a step-by-step approach:

  1. You need to understand the business model of your company enough to understand what your application is supposed to do, and why.
  2. Tests can be a good way to understand the bounded contexts(the different, independent parts) of an application. However, writing unit tests can be a real challenge to write for a legacy application. Acceptance tests can be more useful in that case.
  3. When you understand what your different bounded contexts are, you can separate your application in different microservices. As I explained in my article about simplicity and the KISS principle, an application is simpler when it stays small. However, be sure to understand the challenges and drawbacks the microservice architecture bring.

Trying to improve a legacy system can be seen as an interesting challenge, and where there is motivation, there is less stress.

5. Lack of Mental Energy

The Problem

Using your cognitive abilities will drain your mental energy pretty quickly. Coding require you to use your brain, sometimes intensively; at the same time, your brain is the organ which consume the most energy.

The result? Experts agree on the fact that you can’t focus and be productive more than 3 to 4 hours a day!

Here’s my experience:

  1. The average knowledge worker (including developers) usually “work” 8 hours a day.
  2. Your mental energy will be drained, trying to focus for a long time. If your environment is noisy or, in general, disturbing, it will be even worse.
  3. You will feel more and more tired as weeks after weeks.
  4. Tiredness will taint your productivity.
  5. Lack of productivity and tiredness will cause a cheer amount of stress, which will increase your tiredness. Our vicious circle is back.

The Possible Solutions

First, you should not feel ashamed if you’re not 100% productive every minute of each day. If you feel that you have difficulties to focus, that you’re tired, just stop what you’re doing. Meanwhile, you can:

  • Go for a walk.
  • Have a quick nap if your company allows it. If not, try to explain to you company’s management that a 10 minutes nap can recharge your mental energy batteries.
  • Have a drink in a quiet environment. Water or tea are the best, coffee can make you even more stressed. Skip the energy drink. Sugar mixed with high dose of caffeine never reduced stress. If you don’t like tea in bags, you can try loose tea. There is a world of difference between them.
  • Go chatting with other colleagues.
  • Call your girlfriend, your boyfriend, your friend, your close relative, or your dog. Why not?

In general, if you can do any physical activity, even if it’s only walking or even standing, it can recharge your mental energy to some degrees. Do something different and come back to your code with a fresher mind later.

Sometimes, it won’t be enough. You might need to wait for a longer period of time to let your brain solve your problems in diffuse mode, and going back on the productivity road. In my experience, it could be a day, or even more if I’m really drained.

Patience coupled with acceptance will be your best allies here. Punishing yourself because you think you’re not productive enough will simply drain your energy even more and higher your stress level. Nobody is always 100% effective all day long.

If your company is very strict with your break and what you should accomplish per day, obliging you to stick your nose on your screen constantly, try to find a better company. We’re not robots, and the ones considering us as such will only push us to burnout.

Burnout is not a pleasant road to be on. If your company push you to this dark place, quit as quickly as you can.

6. The Open Space Trend

arrogance and insecurity are totally subjectives

The Problem

Open spaces is the favorite startup organizational trend of the 21st century: take a big room, put some desks, ask everybody to work in there, in order to be more “agile” and “improve communications”, which leads to a chain of events:

  1. The Open space will be noisy.
  2. You will have difficulties to focus.
  3. You won’t be productive.
  4. Stress will pop up.

Last but not least, ideas is not the only thing we communicate to each other in open space: stress can be communicated as well very effectively between coworkers.

If you’re working remote (like many nowadays), you might notice that you don’t need an open space to be constantly interrupted. Your colleagues on slack will happily do that for you.

The Possible Solutions

A good headphone could be a partial solution. If you can’t listen to music while working, there are plenty of websites which can let you mix different natural sounds (birds, forest and so on) or even white noise, which can help you to focus. It might sound silly, but it’s a real life savior to me.

These are my two favorites:

But wearing headphones several hours a day can be tiring as well. If you can’t deal with the open space noise, here are two possible solutions:

  • Ask for the IT team to be isolated its in own space. Your colleagues in marketing, HR, customer support and sales will, more likely, do most of the noise. Not because they want to, but because their work oblige them to often communicate on the phone, skype, and so on.
  • Working from home. My experience: I’m more productive being from time to time at home, since I know the environment and I can control it, according to my needs. Here’s a study about home office and its benefits, in case you want to convince your company to allow it.

If you’re already working from home but you’re interrupted all the time, tell your colleagues that doing pomodoro is very effective with you. Then, cut every possible source of interruption (Slack, mails, Zoom, and whatnot) for 25 (or 50) minutes and enjoy your low stress and your productivity.

Banning Chronic Stress from Our Lives

throwing chronic stress away

There is a lot more to say about stress and how to deal with it. Nevertheless, let’s summarize what we learned:

  • Stress is a natural response to a threat. Thanks to it, we were able to survive and creating the Internet. Stress is still useful today in life threatening situations.
  • Chronic stress is a response to what seems threatening. Depending on the person and its environment, it can be many, many things.
  • Chronic stress has very bad consequences on our physical and mental health.
  • Deadlines shouldn’t exist in the software world, only estimation, that is, a period of time which can be extended.
  • The trendy new technologies are not that new: learn the first principles of software development and learn to identify old technology with a new name and you’ll avoid a tonne of stress.
  • Competition can be healthy, but often it’s only a source of stress. Stop competing for badges and stars and try to solve real problems real companies have.
  • Legacy applications are stressful ball of muds, but you can change your perception and see them as a challenge to tackle. You could even make it your speciality, you will never be out of job.
  • We’re using our brain all day so our level of energy deplete quickly. Learn when you should take a break and if the people you work with don’t allow it, look around and find a better job.
  • Constant interruptions in an open space or via the 9830982 ways of instant communication we have nowadays will deplete your energy, the perfect nest for your stress bird. Isolate yourself for a good chunk of the day if you can and cut all possible distractions, from social media to the Slacks and other noise.

All of these problems have possible solutions we need to work on, actively, day after day. We need to understand that we are not our day job. We are developers, but before that we’re human beings. Being too stress doesn’t make us bad, worthless, or dumb.

We should make our health (physical and mental) a higher priority than our jobs. There are plenty of companies out there, but we only have one body, one brain, and possibly one life.

Learn to stop your run toward success and fame, and try to ask yourself some questions:

  • Do you feel less stress while you’re on holidays? Why?
  • What could be the cause of your stress when you’re at work?
  • How to solve it?
  • Did you try to work less? If yes, do you feel more relaxed when doing so? More stressed?

In short: learn to know yourself. Experiment with yourself, learn how you (your body and your mind) react depending on your actions.

A very important word for the end: as I did at the beginning of the article, if you’re experiencing a high level of stress in your life, speak about it. Speak with your family, girlfriend or boyfriend, friends, colleagues.

Social support is the best medicine to stress.

Share Your Knowledge