Whoever gave Mob Programming its name clearly wasnít in marketing. Who would want to be in a mob? The word mob conjures images of smashed glass and looted stores ó the population of Springfield lined up with pitchforks and torches.
Mobs really are the opposite of what you would want from a successful programming session. Mobs are disorganised, prone to rash decisions, angry and unwilling to compromise. Mob programming however is none of these things.
So what is mob programming?
So what exactly is mob programming? Put simply: 3 (or more) developers, one keyboard. No, thatís not something weird that youíve seen on the internet. Itís about working collaboratively towards delivering high quality software.
Given that most programmers get in hot sweats just thinking about the idea of working with other people, Iíll delve into more detail as to what that looks like. Imagine we have a developer, Steve. Steve works on an app where users can view recipes. One day Steve is tasked with adding a Ďfavouriteí feature to the app. With this feature users are able to save recipes to a a private list called Ďmy favoritesí. If they want to view a saved recipe again, they can simply open the favorite list and select the recipe.
Steve wants to use mob programming to implement his feature, so he books a meeting room and asks his colleagues John and Sarah to join him in a mob. John and Sarah show up to the meeting laptops in hand, ready to take on the challenge of the favorites feature.
So at this point, Steve needs to lay down some rules (yes mobs have rules). The rules might be something like this:
- At any given time one person is the ĎDriverí. The driver is the person with the keyboard and mouse, the driver is the only person allowed to modify the code.
- Everyone else takes the role of the ĎNavigatorí. Whilst the driver spends a lot of their time occupied with the physical task of typing, the Navigator has all the time they need to think, review, discuss, describe. And thatís exactly what the navigator should do.
- Everybody swaps roles ó often. No, this isnít some Ďeverybody gets to playí stuff you heard in primary school. If people stay in one role for too long they can become fatigued. if they have a favourite role then when theyíre not in it they can become bored.
And thatís it ó you now know about mob programming. Add it to your CV.
OK, I get what it is, tell me more
If youíve made it this far down your probably thinking ďWhy is this guy banging on about mob programming? Google literally comes up with 500 explanations already.Ē Simple, Iíve been doing it every weekday for 5 months. Hereís what I have learnt:
Itís actually quite good
I remember when I learnt about mob programming for the first time. I was 19, stuffed in a room full of deodorant free students, in a building that looked as if it should be earmarked for demolition (fun fact: it was). The professor had just finished explaining our coursework on data structures. In the end he quipped ďYou can do this alone or in a group ó In Industry everyone is doing programming in groups, they call them mobsĒ. Oh God I thought, Thereís group work in adult life too.
Whatís amazing is that every time I introduce the concept of mob programming to a new person, the same sense of dread seems to cross their face. Keep your group work to yourself.
Hereís the bad news ó youíre doing group work already. At work you work in a team, you ask them for help, they review you code. Itís the combination of all your efforts that dictates whether your project succeeds or fails.
As soon as you understand that you realise what mobbing really is. Itís not doing more group work but the same amount. The difference is that all of the interactions with your team are going to become super easy, no more wondering what other people are doing, no more.
Mob programming helps you know your colleagues better
If you ever look up from your computer, you might notice that there are other people around. Turns out they have lives too! But seriously, when youíre interacting with people 9Ė5 you get to know them a lot better than you would otherwise.
As programming is a job not a social club we should be more practical about this. Teams that interact well together perform better. Itís a fact of life, hence all those off-sites and team building exercises. Mob teams donít need team building exercises because the teams already work well together.
Being remote is no excuse not to join in
ďBut I work remotely, Iím never going to be in the office to mob with anyoneĒ. Bad news mate, I work remotely all the time. It turns out that in this thing called the 21st century remote working apps are a dime a dozen. My favourite: Slack video call. It has all the features you need: you can share your screen when youíre the driver and use your voice to be the navigator. But maybe your company doesnít have slack, maybe you have something like webex where setting up a call takes 3 years and a research team. In that case whack open a appear.in session and stop making excuses to be unproductive.
I spend more time programming, because I spend less time stuck
So Iím going to admit something, Iím bad at CSS, not just bad ó BAD. so you can imagine when Iím working on a project, say my website (coming soon) , I spend hours of my time bashing my head against the wall trying to work out why my divs wonít align (seriously why?).
When mobbing though everything is different, I donít get stuck on CSS because thereís always a second and third pair of eyes there to help. This means less time banging my head against the wall and more time solving problems.
Thereís no such thing as Ďmy cornerí of the code
Let me tell you a horror story, Itís a story of that bit of code. You know the one. It was originally written by Frank, just Frank. When there were bugs in the code, Frank fixed them. When new features weíre needed, Frank added them. Nobody else in the team knew how the code worked. Just that it did. If it didnít Frank was there. Well one day Frank wasnít. Frank moved jobs and got a big raise, good for him. You however are left with a part of your system that nobody understands and nobody wants to touch, enjoy.
Mobs however write things as a team so thereís never a mystery area of the code. If an area is a mystery now then mobbing with the writer will soon bring the mystery to an end.
So thatís what Iíve learnt (so far) about mob programming. To be honest Iíve been genuinely surprised just how much Iíve embraced it both as an enjoyable way to work and a way to approach complex technical problems. Of course at this point youíre probably more concerned about how I missed that important positive (or drawback) out!
ó Sam Fare, Software Engineer, Compare the Market