Sustainability in Software Engineering
Let’s start out with a clear statement: our entire IT infrastructure is built on Open Source. Many of the basic tools in IT, from small libraries to entire operating systems, are developed and maintained by people with a passion for software development, often in their free time. It started out that way because they enjoyed hacking on things to make them better. Some of them were able to make this their jobs and earn a more or less comfortable living. But the reality is that most people haven’t: some still work on those projects in their free time, and some have had to give up.
When I talked to Derick Rethans, the author and maintainer of Xdebug, during my last job interview I started thinking about our reliance on Open Source and the strain this puts on maintainers. Xdebug is an absolute must-have for every PHP developer. One of the first things I do when I set up a new project is to make sure I can debug using Xdebug. With this, I’m able to quickly debug an application and find the problem by slowing down the code and thinking along with what’s happening. I evaluate variables and statements and go up and down the call stack to see how I ended up in the current frame. If I were to sprinkle debug output throughout the code and go through the log files, this process would take significantly longer. Xdebug probably saved my various employers thousands of Euro over the past years by speeding up my development workflow. Have any of my companies ever given even a tiny percentage of that money to Derick, if only to show appreciation for his work? No. Have yours?
As much as I want companies to fund Open Source, I also understand their point of view: for most businesses, the goal is to make as much profit as possible. For most startups, the goal is to become profitable quickly before the money runs out. So if companies can save a buck by using a free solution and avoid license and other costs, they will do so. Just look at your typical tech stack: Linux is used as operating system, Apache or nginx as web servers. Install haproxy as a load balancer in front of it and PHP as scripting language behind it. Our stack needs a database, so let’s install MySQL or PostgreSQL. Caching might also be useful, so Memcache, Redis, or Vagrant will be installed in some combination. To avoid having to re-invent the wheel, we’ll start out using Symfony and Doctrine, install some open-source bundles and write some custom code. Sound familiar? You can build an entire business without having to pay for a single license. You don’t even have to buy hardware if you’re comfortable running your application “in the cloud”. By using docker and kubernetes the system administrator becomes obsolete, and as an added bonus the company can slap a “devops” buzzword on its job offers.
Open Source is a Slippery Slope
While these things have no cost for a company, they’re not entirely free: someone else is paying for them. In the worst case, the developer of the tool is paying for it with his time. This isn’t always what one expects when starting a new project. When I created mongo-php-adapter a few years back, I had only one use-case in mind: I needed to buy time to rewrite the entire data access layer of the Doctrine MongoDB ODM to use the new MongoDB driver. PHP 7 was the hot new thing, and our users couldn’t upgrade because of the MongoDB ODM using an old, deprecated driver. To quickly ease the pain, I spent my Christmas break writing an adapter that provided the legacy API built on top of the new MongoDB driver. With this adapter, people could continue using the ODM, upgrade to PHP 7, all while I was trying to find the time to make the necessary changes to the ODM itself.
As it turns out, it wasn’t just the Doctrine MongoDB ODM that suffered from the driver problem: many other applications built on top of the legacy MongoDB driver suddenly needed a sizeable effort to be updated to the new driver. For a lot of engineers, this library was exactly what they needed: they could move their applications to PHP 7, use a supported driver, and didn’t have to justify to their boss why they need to almost rewrite the entire data access layer. Like many other Open Source engineers, I never thought that so many people would start using something I built to solve a problem I thought only I had.
I was in a lucky position: there weren’t many bug reports, as the scope of the library was pretty limited and didn’t contain all that much logic. When there were bugs, I was able to justify working on them during my paid work hours, as we were using MongoDB ODM and the adapter library ourselves. My boss and I had an agreement that I get to spend a certain amount of time on the Open Source libraries that I like to maintain, especially if they were used at the company. This extended to other engineers as well: anyone was encouraged to work on Open Source projects. Few people chose to do so, but for those that wanted to, being allowed to take a few hours of paid work time for their passion projects was a great deal. So, that’s how we can make Open Source sustainable. But is it really the solution to the problem?
Making Software Engineering Sustainable
When I started my last job, it was with people that I have known for 6 years. In fact, we’ve worked together as a team at one company, then collectively moved to a newly-formed company to build an e-commerce application on a green field. It was the dream come true. While we talked details, I was pretty clear about my Open Source responsibilities, and that I’d like to be able to work on Open Source projects during paid hours. It was my way of ensuring that the company gives back to Open Source. My boss was fine with this, especially since we planned to use the libraries I maintain. The people funding the company were ok with this, because they knew that it was the only way to get the entire engineering team. Everybody saw it as a win for them, the company, and the ecosystem.
The contract was typical for an IT job in Munich and most likely Germany: 40-hour work week, overtime is not paid. We got 25 days of paid time off, which was more than the 20 days required by law, but less than the 30 days usually given to engineers. The pay was a little higher than average, but not unreasonably high. Combined with the ability to work on Open Source projects and finally getting to build software on a green field, this seemed like an absolute win to me as well. Spoiler alert: it wasn’t.
Before I go into details, I’d like to add a short disclaimer: this is my personal story of how this setup wasn’t sustainable for me. I am very well aware that the above contract is very good compared to what is standard in other companies or other countries. Yet it is the only example I’ve personally experienced, so it’s the only one I can use to show why even this isn’t sustainable. I’d love to hear stories of people in similar or completely different situations, and to get different points of view on this issue. The problems I outline here are my personal problems, and yours may vary. Some people will see my problems as minor compared to theirs, and that is fine. Maybe they are minor problems, but they are still problems for me.
I mentioned that my contract specifies that overtime isn’t paid. This is normal in most IT jobs here, and most candidates never raise a point about this. After all, we love our flexible hours, right? You get to work when is convenient for you. If you need to leave early to see a doctor, go and leave early. If you need to finish something, you stay late to finish it or do it on the weekend if it’s really important. What I’ve learned over the years is that while this is what you have in mind, it’s not always what your boss has in mind. Case in point: I wanted to leave work early twice a week to pick my son up from daycare and spend time with him. When I suggested to my boss that I’d like to leave an hour earlier and then work from home in the evening to make sure my work gets done, he wasn’t entirely convinced of the idea. I started doing this once a week instead of twice and enjoyed every second I got to spend with my son: we’d walk through the park, enjoy a snack by the lake, and just unwind after a hard day of work. It was perfect for us. It was perfect right up to the moment where my boss told me that it’s a bit inconvenient because “when somebody leaves early, it demotivates the rest of the team”. Wow. I later found out that my boss himself came under fire from his bosses because the engineering office was “deserted at 5:30pm”.
I ignored this and kept doing my thing. Every Wednesday, I’d leave at 3:30pm, work another half hour in the train on the way home, then spend some time with my son. Why would I change something? I normally started working at 7am, so even accounting for an hour of lunch break, I accumulated 8 hours that day, and I haven’t even done my “work from home” thing to catch up on work that happened after I left. Still, it left a bad taste in my mouth. This was my employer telling me that they weren’t happy with me taking time for my family, time for myself. It was important to me, but they didn’t care.
As always in tech, there were times when we had to get things done by a very ambitious deadline. But while the contract says that salary covers any and all overtime and we aren’t entitled to extra pay, this isn’t the entire truth. German law sets a lot of rules on how much overtime can be required, and how an employee has to be compensated for it. I’m not a lawyer so I’ll keep this simple and incomplete. In a nutshell, if your employer just expects you to work overtime, you can ignore them. An employer can mandate you to work overtime, but there are limits as to when they can do so, for how long, and how much overtime they can require. Many people see this as the boring part of labour law, but it’s an essential part. By law, you may not work more than 48 hours per week. This can be increased to 60 hours for short periods of time, but has to be settled within 6 months. When I say “settled”, I don’t mean “compensated”: you’re entitled to time off. German law knows that while money can buy you a lot of things, time isn’t one of them. Same goes for weekends: if you work on a Sunday, you’re entitled to a full day off within 2 weeks.
Employers count on people not knowing this, and they get away with it. Many people currently working in IT are young. They don’t have families and enjoy working in a fast-paced environment with lots of challenges and likeminded people. So when our bosses asked us to do overtime, most people were perfectly fine with it. Some employees even previously lobbied for the team to work more hours because they like it “when the team is in the office on a Friday night to make the sprint goal happen”. I may be getting old, but I’d rather sit at home reading my sons a good-night story before bringing them to bed than sitting in the office at 9pm on a Friday night.
Getting “Paid” to Work on Open Source
Why am I saying this? While I was able to work on Open Source projects during paid hours, I could only take 2–3 hours every week to do so. Most of this was done on Friday mornings, when my wife worked from home and I didn’t have to bring the kids to daycare. I left home at 6am, sat down at my favourite coffee place and worked on Doctrine projects for 90 minutes before going to the office. The rest of those weekly 2–3 hours was spent looking at issues as my GitHub notifications filled up during the week (whenever I have an unread notification, I can’t not look at it — it’s a big stress factor for me). This wasn’t time spent on some random project that played a minor role in our tech stack. This was the back bone of our business: storing data in the database and retrieving it. Without my work and the work of my co-maintainers, we wouldn’t have been able to build our product this quickly.
Over my 3 years at the company, I averaged around 46 hours a week. Due to the language in the contract, any overtime was immediately “lost” and compensated for. I was able to shift around some of those hours (e.g. by leaving early once in a while), but it’s not like I was able to work 46 hours in one week and then recoup those hours by not coming in for a day the week after. Since my employer paid me for 40 hours a week, I effectively only worked on Open Source during my free time. I kept telling myself that I get paid to work on Open Source, but I didn’t.
Change is necessary
You may be wondering why I’ve written about this very personal story. The truth is that when I got the opportunity to join MongoDB and left my company, things turned sour quickly. I am currently in a legal battle against my previous employer over unpaid bonuses. I’ve also been accused of having neglected my actual job to work on Open Source software, giving away intellectual property to competitors, and only furthering my own career. I have been struggling with depression before, and this episode brought me to the point where I was contemplating suicide. I am currently getting treatment for my medical health and I am progressing slowly. But every time I get a letter from my lawyer or from the court, I notice that I’m not there yet. That’s what I mean when I say we need to make our jobs more sustainable.
I’m 35 years old, I’ve been writing programs since I was 14. I started working with PHP 15 years ago, and it’s been my job for the past 11 years. In these 11 years, MongoDB is now my 8th employer. I’ve quit one job on the second day of employment, and I’ve had to quit one job before I started because my mental health at the time didn’t allow me to work. My last three employments have taken up 7 of these 11 years, so it has settled a little bit. This isn’t just me: most of my coworkers in previous jobs have similar numbers. I’ve seen people come and go at a record pace.
I’m 35, and the retirement age in Germany is currently 67. I have to work for almost 32 more years before I can retire with full benefits, whatever those will be when it’s time. If the previous trend continues, I’ll have worked for more than 30 companies by then. But it isn’t just that. The oldest candidate I interviewed was 39. The oldest coworker I had ever was younger than 50. Can you imagine being 60 years old and looking for a job in our industry? Can you imagine interviewing with a person who is significantly younger than your children? On the other hand, can you see yourself interviewing a 60-year old candidate? Would you give them a fair chance, or would you rather hire a young, dynamic, 20-something person who’ll happily work 50 hours or more because they don’t have a family waiting for them at home? A person who argues to work on the weekends to get something done because they don’t know that the employer is legally required to give them a day off in return?
With my new job at MongoDB, I’m now able to make some changes. I can work from home (or any other decently equipped office for that matter), and since my team is in New York City 6 time zones behind me, my working hours don’t play that much of a role. This way I’m able to start working early and get out early to spend time with the family. I can also take a break during the day and work late, especially if I have meetings to attend or if I want to pair-program with someone on my team. The flexibility gives me a certain peace of mind, and it increases my productivity. I’m also allowed to spend more time working on the Doctrine MongoDB ODM, going as far as scheduling it in our issue tracker to ensure the driver change mentioned above finally gets done.
So while we definitely need to make Open Source sustainable, we also need to start making our jobs, and our industry more sustainable. It surprises me that in an industry where all we need to work is a computer and a working internet connection, we still require teams to be in one location at the same time, every day. It surprises me that many companies and many bosses have an issue with their employees taking time for themselves or their families.
It is on us to change this. Go home at 3pm once a week to to whatever you want. Work from home regularly and focus on your mental wellbeing. If you are a manager, give your employees the freedom to do these things, and allow yourself the same freedoms. Go ask about working part-time if you can afford it financially. Work 35 hours a week or even 30, and spend the new-found time to do the things that make you happy. You’ll notice that it not only improves your productivity and your happiness, but it also makes it normal to put our lives and health first, instead of focussing only on our job. After all, life’s too short to only enjoy it after retirement.