Generally, developers are self-motivated people, many taught themselves how to do code in their spare time, and it eventually became a job. A grand majority also codes outside of work hours as a hobby.
I remember when I used to sit until the late hours of the morning developing something, just because I felt that it needed to be done then and there, no matter if I was feeling hungry, tired, or skipped important chores for the day. The single most important thing was taking my current tasks to completion.
At one point, in an old company I worked at, I switched teams.
My expectations were high as everyone around me was way more senior than I was, so I expected to learn a lot.
One morning, after the standup meeting with the SCRUM master, where she was telling us how important these current tasks were, and how time was not on our side, a co-worker sits down and starts to code.
After about 10 minutes he stops coding, browses to youtube and watches an hour long video of how to sharpen a chisel.
That's right, an hour long video about sharpening a chisel!
Whilst he was watching the video, his attention was required by other co-workers and random office noise. He was interrupted maybe five times in the 60 minutes of the video, so he took closer to two hours to finish the hour long video. Shortly after that he went for lunch.
Had he been coding, the interruptions would have been there too, but shifting your focus from a creative task and back again requires tremendous amounts of energy, in order to save that precious energy, his brain subconsciously decides to watch a youtube video because it's easy, instead of coding.
The true cost of a distraction
Before moving on, I want to write a little about the hidden costs of distractions. If someone requires your attention for five minutes, it doesn't take only five minutes away from your task.
When shifting your attention between contexts (complex coding tasks and distractions), you can lose up to half a day to get back to where you were. Coding is complex, holding complex thoughts takes up a lot of precious energy.
If your work environment fosters distractions (commonly known as ├?┬ó??open space├?┬ó??), a grand majority your engineers will be stressed to the bone, and probably doing 10% of what they can actually accomplish.
Going back to our chisel guy: he knows he won't be able to focus on the task for more than 20 minutes before he's interrupted, so he doesn't even start. He instead does something that requires minimal concentration, he distracts himself to avoid the energy draining task of switching contexts.
This shows that 20 minutes into his work day, his brain is already depleted of energy. This energy is precious for creative jobs, without it nothing gets done.
Now here's the strange part
Since this spiked my curiosity, I asked around. And found out that in his spare time outside of work he goes and works his own projects that he's actually passionate about.
So, during the day, when he's getting paid to code, he is watching YouTube videos about things nobody really cares about, wastes hours of his life he will never get back, and wastes his employer's money.
And when the day is over and he's back home, he then starts actual coding and productive work, in an environment he controls, and with minimal distractions.
I think not. The workplace is currently the worst place to actually do work!
After working in an environment that doesn't allow you to focus for too long, your brain becomes used to not being focused, and it affects your cognitive and creative abilities, leading to worse work, and costing your employers a lot of money.
In fact, according to The Telegraph:
Office distractions cost employers up to 3 hours per day, this is 60 hours per month.
This study was not done with software engineers in mind, so I expect the data for software engineers to be even more shocking.
Let's do the math and see how much these distractions cost you:
20 engineers at 30 E per hour = 20*60*30 = 36,000E
36,000E wasted, per month! And that's assuming these 3 hours are realistic for software development. Which, as a software developer myself, I can tell you is not the case.
What's the solution?
Well, realizing there's a problem is the first step. Many companies either don't realize or don't care.
Having a heart-to-heart conversation with employees is the next one, I have been through this before in previous leadership roles, and all the answers I got were the following:
More flexible schedules
More home office
Depending on the environment at your company, you may not get honest answers. People are complex, group dynamics are even more complex, and as a boss/leader, your authority changes the group dynamics whenever you're in the room.
But I guarantee you, if you're not offering very flexible schedules and home office, you're literally throwing money away.
I understand the fear about allowing home office, but if you can measure your productivity with an accurate metric(tip: lines of code is not an accurate metric). You can see if it improves or not, and with a proper strategy it will always improve.
This is an incomplete solution. I would love to hear your opinions in the comments!