What makes YOU stay many years in a job?

Felipe Besson
6 min readNov 6, 2020

What factors lead developers stay longer in their jobs based on the Stack Overflow's developer survey data from 2019.

Photo by Joshua Aragon on Unsplash

Introduction

Different developers have different needs in different moment of their careers. Many companies also invest heavily in becoming the dream job for many talented people. But, what leads most of developers to stick to their current jobs ?

As a developer, I probably have my own bias towards what leads me to stay longer in a job. However, I wonder in general what factors actually makes developers to stay longer in their current jobs.

I am big fan of using data over opinions. Then, I've decided to try to use a very good dataset about us (developers) to answer this question: Stack Overflow's 2019 Annual Developer Survey.

This survey data contains reviews from around 90,000 developers from 180 different countries. In 2019 survey contains 85 questions and aims to understand multiple aspects of jobs related to software development and data analytics.

I've broke my analysis down into 3 main sections below. I worked with the subset of developers who answered the following survey questions:

Which of the following best describes your current employment status ?

Answer: Employed full-time or Employed part-time

When was the last time that you took a job with a new employer ?

Answer: Less than a year ago, 1–2 years ago, 3–4 year ago or More than 4 years ago

Part I: Does the job role lead developers to stay longer in the job ?

To start dealing with this question, we will analyse the distribution of Last Hired Date by job role.

Figure 1: Distribution of Last hired date by job role

The plot indicates that professionals working in management positions are longer in their current jobs. About 42% ofSenior executive/VPs and 37% of Engineering managers are more than 4 years in their current jobs. A good hypothesis would be these professionals developed big portion of their careers in the same company.

For the remaining job functions, the data suggests being less than 1 year in the current job is the most common period (in percentage) among developers. Are these professionals in the beginning of their careers ? To answer that, we can analyse what some of these developers answered for this question:

How many years have you coded professionally (as a part of your work)?

Figure 2: Distribution of years coding as a professional by job role

These distributions for management positions have a higher mean. Then, on average, managers have more years coding than other professionals. It may explain why most of non-managers professionals are less than 1 year in their current jobs.

Part II: Does wishing to become a manager leads developers to stay longer in a job ?

Our data indicates developers who are already in a management position are longer in their current jobs. But does wishing to become a manager leads developers to stay longer in a job ? That may be the case when a professional develops a long portion of the career in the same company.

To answer, I've analysed the Last Hired Date of developers who answered this survey question:

Do you want to become a manager yourself in the future?

Figure 3: Distribution of Last Hired Date when developer want to become a manager

This plot reveals quite surprising findings as the data indicates that developers who do NOT wish to become a manager are longer in their current jobs. More than that, around 27% of these developers are more than 4 years in their current jobs.

About 41% of developers who wish to become a manager are less than a year in their current jobs. Finally, related to Part I of this analysis, most of developers (around 62%) who are already managers are at least 3 years in their current jobs.

Part III: What other factors lead developers to stay longer in their jobs ?

I was also interested in analysing what factors can lead developers to stay longer in their jobs without my own bias. So, I've tried to predict how long the developer are in the current job and analyse the impact of each factor in the prediction.

To simplify the problem, I reduced it to a binary classifier by converting Last Hired Date into a binary dependent variable:

  • Class 0: if developers are less than a year ago in their current jobs
  • Class 1: otherwise

This way, our model predict whether developers will stay more than 1 year in the current job or not. I used a Random Forest classifier model with 135 features that were all based on the Stack overflow survey data. You can find my code here.

My model had an accuracy of 73% and I was interested in understanding the importance of each feature in the prediction. I started picking randomly a sample instance classified as 1 which means the developer is more than 1 year in the current job:

Figure 4: Feature importance when developer is more than 1 year in the job

These are Shapley values for the model features. They explains the importance of each feature in the prediction. Feature values in pink increases the prediction. Size of the bar is the magnitude of the feature’s effect. Feature values in blue cause to decrease the prediction.

In this sample, we can observe the following features contributed more to have a positive classification (class = 1):

  • Looking for a new job (I am not interested in new job opportunities = 0) It may indicate developer is already quite some time in the current job.
  • Have good experience (at least 5 coding as a professional)
  • Have many different job roles

By analysing a larger random sample including also developers who are less than 1 year in their jobs, we have these Shapley values:

Figure 5: Overall feature importance in a larger random sample

It worths noting the developer professional coding experience, the fact the developer is looking for a new job or not and the person’s age have higher contribution in determining whether developer will stay longer than 1 year in the current job or not.

Conclusion

Based on Stack Overflow 2019 survey data, we have analysed which factors lead developers to stay more years in a same job.

  1. Being less than 1 year in the current job is the most common period among developers. Most of managers are at least 3 years in their jobs and this longevity seems to be related to their professional coding experience.
  2. Being less than 1 year in the current job is the most common period for developers willing to become a manager in the future. And those who do NOT have this wish are longer in their current jobs.
  3. Professional coding experience, the fact the developer is looking for a new job or not and the person’s age are good proxies to predict whether developer will stay longer than 1 year in the current job or not.

This analysis was an exploratory analysis, not the result of a formal study. Then, the question is still open:

What makes YOU stay many years in a job?

My story was inspired by Josh Bernhard’s analysis: How will you break into the field? To see more about my analysis, please check my Github here.

--

--

Felipe Besson

Passionated about data science for Search and Recommendations