 is how can a distributed team still collaborate closely and I think that there is no closer form of collaboration than pair programming. So with me to demonstrate this, I've got with me Neroeke Ruhanage from Sri Lanka, say hi Neroeke and later we will be demonstrating remote pair programming. But the more important question then how can a remote team collaborate is how can any team collaborate. So I'm hoping that even if you're not working remotely that you will be able to use some of the techniques that will go through to work better in your local team as well. So before I start I'm going to give you a little bit of a competition which is to find the blue sentence in the talk. So whoever finds the blue sentence will get some extra chocolate plus plus an issue of our exclusive XLE magazine with lots of technical articles. Alright so here's a hint this is the first word in the blue sentence. Alright so you should keep the rest of the word secret so you win the price. So this is a talk for you if you're working on a team so who's working on a team? I thought so but it doesn't really feel that much like a team it doesn't feel like a team as it does in the movies. Whose team feel like it does in the movies? Alright so we want our teams to feel more like the teams in the movies or at least the the teams in the books and even more how do we get our distributed teams to feel like the teams in the movies. After the talk I hope that you'll be motivated to start working with pair programming even remotely that you'll have seen an example hopefully a successful one of remote pair programming and that you have some idea of how to get started. So is there anybody who's pair programming using pair programming as their preferred approach to how they work in their team? So you got so could you keep your hands up so there's one two three four five people here so the rest of you take notice of these people because you want to talk to them afterwards. So I'll go through what it feels like when you're when you have a team that feels like a team in the movies and then I'll talk about what it's like when you don't have a team like the ones in the movies and then I'll talk about how we can use pair programming to create that super team and to get the benefits out of it. So what is it like to work on a super team? I think that the most essential thing is that you don't feel like you're working alone you feel like there's somebody else out there you feel like we're together in this and I'd like to share with you an experience that I had just before the last time I gave this talk. So my college a college Chintaka had just started working on a task and he was kind of stuck and he saw that I was online and we had been discussing this before so he started a chat session with me and said okay so could you give me some clarifications on some problems I have and then there was a simple clarification on how things were supposed to work and and then his first problem was solved but then it seems like when he started testing his application you had one of those bugs that feels like a rabbit hole you know so it seems he says it seems that I'm not getting the people I have already created when I try and access this thing so his solution just doesn't work when he tries to integrate it and he's wondering if it's because he's using a trial account on the service that we're accessing now this is one of those rabbits hole because that was not what the problem was so have you ever had that situation where you're like okay that's where the problem is and then you'll spend all your time trying to figure it to fix that problem and it turns out that it was completely different that's the rabbit hole that's where we don't want to go so we sat down and we started working together and the first thing we do when we start working together is to get a shared context of what are we working on in this case we wanted to see the same results on his computer and on mine and then we share some experience so in this case we were trying to get a rest-based web service to work so I had some experience using curl to do kind of low-level checking if it works so I told him how to get started with that so we already have some sharing of knowledge and then we're starting to experiment and try and find out what's going on and I think I see the problem and then I say okay so this is a problem but it wasn't of course so we're trying things out together and then we're creating this thing called that I think of as a working baseline so we had the example that didn't work we created an example together that did work shared that so he got that to work and then we got to that moment that you that takes a while to get to when you're alone but not so long when you're together which is the huh that's strange so it acts differently when I try and do what I thought was wrong on the system we're testing and the system that we know is working so there's something that's strange here and then he spots it and we verified both that it worked and from he called me up until his problem was fixed it took about 20 minutes where 10 minutes were spent finding and installing some tools where we're really off on our own so the clock time is 10 is 20 minutes and that's what it feels like to not be alone with your problem so when you're when you're alone you have those situations where you've run down the rabbit hole you're hitting your head against the wall for hours when you together that goes much faster and just for a for reference I asked him if I could use this transcript for the talk so that's some fun collaboration that happens remotely just as easily as it happens locally and it shows how you deal with problems when you're not alone so what does it feel like when we're on a team where everybody's alone so this is the example of the team where we're all alone and you have the scrum master only two problems with scrum masters the word scrum and the word master all right so of course the scrum master helps us plan our work so he says your honours you'll create the crud service a crud soap service for the project applications okay I'll do that that's how we self-organize around tasks how long will it take I've never done this before I don't know but luckily there is a developer on another team who says oh this is pretty easy to do with hibernate oh cool let's say eight hours then there is a warning here when a developer is estimating hours something is wrong but that's another issue especially when there's something they don't know all right so we've planned the work and we're doing the stand-up so the first thing here is that I was alone in the system a treat because I was the only one on this team that could do it there was a developer another team that gave me some information but I had to do the estimate so we've got the standard meetings the three questions at the standard meeting today I will work on create project yesterday I did the planning so that's not so interesting and I have no impediments because I don't know what's going on so how can I have an any impediments and then I start working and so headphones on I'm sitting on my own code is flying out of my fingers until the exception happens so I got some kind of exception and of course what do you do when you're when you get an exception and you're working alone it's the software development lifecycle Google-driven development you get an exception you Google it if you're lucky you find it on stacker flow you treat tweak what you do you redeploy the application you poke it to see if it happens again and of course it happens again because you only skim the top of the article so you Google again and so it goes so this is this is our lifecycle start after lunch and then we keep working for a few hours and a few more hours and then eventually we go home and then we've got the next stand-up meeting and yesterday I worked on the create project story and today hopefully I'll fix that damn exception and also do delete project because you know the first story was only supposed to take eight hours but I've already spent more than that but hopefully I'll be able to do both catch up for the time and of course I have no impediments because everybody else has got their problems they're working on the front end or as on the database or with the design so I'm stuck here alone with my exceptions and my hibernate and all of that all right but this time it was I was lucky because somebody answered my stacker flow a problem report and here's the the fixed so I fixed a problem and then I can get back to work again so headphones on and focus on the problem until the other exception happens and then we got into the Google-driven development again so and the next day so hopefully I found the fix for this and then the next day I said okay I finally delete finished delete after three days of coding and then of course the front-end developer who was going to use my service as well I didn't need the delete service I only needed to create an update except that of course he doesn't say that because he doesn't know why I did the stuff that I did anyway because I'm working on a different part of the project and that's where we need to stop and take a step back and look at what we're doing so let's imagine that we're supposed to carry ten logs of timber from this room to the next room and each piece of timber is three meters long and weighs about 30 kilos how would you go about carrying that about timber would you do it alone or would you pair up with someone right and so when we're doing development we've got fairly heavy loads that we're lifting do we do it alone or do we pair up right we do it alone but we probably should pair up so yes he's a new rook are you back so we do this connection every now that you can re-enable your video so the video drops when the call drops can you still see my screen can you still still see my screen so I worked on about ten teams closely and the three most fun teams I worked on they worked something like that so we have the stand-up meeting and at the stand-up meeting I'm ready for a new task so we look on the board we see what's there so the first thing is that we haven't already assigned all the work because I'm the not the because if we have assigned the work then I cannot help someone else because then I will flack off of my work so I look at what's on the board so let users administrate their project is on the board all right so we'll do that but I haven't done any hibernate before and this looks like something that requires hibernate is there anyone that I can pair with and then someone says yeah sure I will pair together today I worked with hibernate before I can help you out with that and then we work together so now we're working on the same screen or if and then we get to the exception and yeah so technically we're not working on the same screen because we're remote so we're working on different screen but we see the same thing and we see the same exception the same exception as before and then we might be in the same situation as before we maybe do a little of Google-driven development but of course we're saying we have someone else to count for our time so I might say that link doesn't seem really relevant and we might take a step back and say okay let's see what how else can we figure this out could we ask for some help and I think that Lucas worked on this sort of thing before and he's sitting right next to one of us with his pair and he says yeah just have a look at this other class where we did the exact same problem and he might not even need to get out of his context in order to help and now we know that the information is getting shared among the team so there's always someone there who knows and then we found the problem high five so in this sort of model there is no area that anyone is dedicated to if I'm a back-end developer it means that I can help someone else do work on the back-end but or I can work on the front end with help from someone else and that means that the knowledge is spread around the team and it means that when you're stuck which I think most of us as developers are stuck more than a couple of times per day you're not alone so how do we get to that sort of happy state and I think that the key process that we that will give that team feeling of the team that you see in the movies is pair programming I'll introduce a few pair programming styles and I will demonstrate one of them so there are some ways to do it wrong I have one very good friend and an experienced developer bless his heart who always wants to debate the name of a variable or whether the casing is correct or whether we decide this right so everything is slowing down so that's not what it's about it's about helping each other go faster and helping each other learn another very so a useful way of thinking about it is to is the model called the driver navigator no that this that is a different model this is a very cool model but I don't have time to talk about it's it's very cool but here's another that's easier to talk about which is if I know something then you're the one who's typing it if you know something I'm the one who's typing it so the information never goes through that out of the head of the person who knows and through the keyboard it goes through the head of the person it's a very useful way of making sure that people are getting faster another of my favorite ways to do pair programming is very useful in the training session and it's often called ping pong programming so it consists of some ingredients and it's kind of wraps together the core part for me of extreme programming very well the first thing pair programming we've got two people one at each screen in this case it's me and niruga the second ingredients test room development which means we write a failing test before we write the code that makes it pass so we write the task we make some writes and code we write some tasks we write some code and then the third ingredients is that we're refactoring all the time so we refactor when the code is green and if we put it all together one person writes the failing test another person makes it pass that person writes the failing tests and the other person makes it pass again and we do refactor in between so in this case I think I'll be writing the first failing test and niruga will make it pass does that work for you niruga so here's the actual demonstration so we got niruga on the other end and the problem we'll be working on is converting numbers to text so I briefed you on the problem beforehand niruga could you review what you what you learned about it yeah so could you just could you just explain the problem that we're solving we're trying to create a function that when you pass an integer number you want to get the English word for that let's say you should pass one you have to get one 150 get the text 160 yeah so I made a structure that gets the number is up to about a hundred to work but then I have this new test 145 so I wrote the test just before I connected to you and when I run it here you'll see that it oh dropbox fail very deep trouble alright I think we might have to switch model so if the if the test fails yeah so it doesn't make this test pass it says 145 but it doesn't know what to do with 140 so do you want to do you have the code on your end I'll show your screen I'll see I see a screen all right so I hope that the audience can roughly see it as well all right so where you get the same problem on your end yeah so we're not so I wrote doesn't deal with numbers bigger than 100 so I think you can just do the same thing for the 20s check for the 100 for now I think you can just return 100 and then convert the rest you mean just return 100 yeah so say 100 and then you can call it the person yeah one of the confusing things with the English language yeah so we'll use a red function here yeah so we'll do it by 100 it will hit us one that sounds good yeah that should be supported by the right so you need to say have space before 100 and then and afterwards that I think that should pass high five right so yeah you want to write the next test I think it should work I think the next thing should be thousands right yeah I think so maybe do you like five thousand four hundred and something yeah perfect yeah you got a see at the end of six there end of the string yeah it's it yeah I'll take over make it pass yeah all right so can you see my screen yes all right so I'm running the test to make sure it fails on my end as well and here they were you put in an extra C there so I'll just remove that okay so it says five hundred five thousand four hundred percent that says fifty four hundred and fifty six that's that's pretty straightforward we just need to do this again so thousand and then I'll just flip the rest into the convert function right this yes right so that should do it really high five all right so yeah so what's next yeah oh yeah I think you're right so if I do one hundred then that that would fail that that wouldn't match that block so I think that would fail oh right so it says doesn't know what to do with a hundred do you want to fix it all right so it's still uploading here on my end so yeah I got it got it think somebody in the audience had an idea what was wrong but all right so good let's go to the numbers to English there yeah so the first problem is that it's a greater than or equal to if that's gonna work yeah all right let's just add it to the to the switch then you have to say 100 and I think you need to remove that greater than yeah all right nice high five all right now somebody in the audience said that this is probably not gonna work so well so let's try 200 bills because it says don't know what to do with zero yeah so it was trying to say 200 zero shall I take over running it again so I guess that if the number is exactly divisible by 100 by 100 is like this so then we have to do something else right do you think of this how do you like that nerooka any refactoring and I think we'll leave it at that but because we need to return to the topic but I saw one other problem so there is like if we say five thousand and six you say five thousand and six right but that the and comes from the hundreds so that will fail so how do we deal with that it says five thousand six I think we'll leave that one as a puzzler to the audience all right so nerooka what does it feel like to program like this in the other part of the world I think for me when we do program they are programming with the guys in the office on show they give lots of input to our domain knowledge and we are doing that and it is very helpful for us to improve our domain knowledge as we are gaining when you have a good domain knowledge it is really easy for us to work on that is the most I think in this we want to have a problem but we have to do it it's really fun because if you don't know even if you have a problem you can only go to other colleagues and we have some discussion about it before coming people make this word they are programming we used to do these things but even though you don't know but if they are programming you go to other guys and you work with them and but now it is coming to a more serious thing and we getting to different practices we are applying but my feeling for this we know that program is more serious beneficial for us like the official companies to get more understanding of the domain and the video games that we can also thank you so thank you to Neroca seeing kind of what pair programming can do to transform a team and you have seen how it works in a remote setting like this so how do you get there the first thing that is imperative to make pair programming work is to make the active sharing or to make sharing into goal for the team itself so one of the teams that I worked on came up with this thing that I call a pair programming star so here comes the audience participation thing so in this team who is the person who might not be doing such a great job Sergei that's a good guess but it's wrong but you still get a chocolate alright who did you suggest Johannes yes why is Johannes doing a bad job exactly so he is not spreading the knowledge alright so I gave you a hint there who is doing the best job in the team Delipa so who said Delipa alright alright so why is Thomas doing a good job he is pairing with everybody great oh sorry so Thomas helped spread the knowledge in the team and in this team by putting this on the white board of the team everybody knew what the rules were and what the expectations were so it doesn't have to we don't have to tell people that they're good or bad maybe Johannes had a very good reason for working with only with Delipa but it is a it shows us what's going on in the team this one is more complex so here we got some user stories so add a new company display context on the map filter context in the list authenticate user by company store password securely and user names with no region letters are not displayed correctly so this has to do with companies and contacts and something with users so this seems to be a user thing so which of these stories would you yeah so which of these stories is in the red which of these stories would worry you that's one yeah why you're right so only Thomas knows anything about it now in this case is this a problem what do you think yes is there any reason it might not be a problem it depends on the working world and this sounds it says Norwegian names with Norwegian letters are Nuruqa except under Nuruqa it says displayed incorrectly this is a bug report so it might not be a problem it might be a small task it might be something that's covered but at least it's worth paying attention to all right so when we look at the team members who do you which of these team members would you say is doing a good like which of these team members should we applaud so yeah so people like Thomas he's doing a good job he's going all around there now is there any other person who's doing a good job because I have someone else in mind here why would you like a runus so can anyone see why I like Sergei here without Sergei this would be two teams so we're also looking for people that bind the team together so Sergei is also in the green here now this is now all of this is sort of things to discuss so it isn't right or wrong it is tools that help us bring forward what we mean by knowledge sharing as a goal so the first thing is to make knowledge sharing as a goal and then there are some problems so some of the problems that might get in the way to do proper pairing if you have a task tracker tool that assigns one person to a task and especially if it assigns one person to a task in the beginning of a sprint that absolutely kills a pairing so if you have a true team then no team member can own something that's happening in the future so if I have five tasks that I'm waiting to do then I will not help Budhima complete his task because then I will not do my tasks right so what I like to do is to have a team member that has the option of having more than one person at the task so anyone can only be on one sticky note most sticky notes have two people and some people might not be on the team today they might be on vacation or sick or whatever and the things that we haven't started doing yet don't have someone assigned to it and just do what you guys have who's got more than one head? who's working on more than one task at the same time? we should be working on more than one task at the same time you'll get one for clearly so we can't work on more than one thing at a time so we shouldn't be assigned to more than one thing at a time so if we do things as a pair we will get more done the teams that I've seen do this get more done and quite dramatically but it doesn't happen in the first or the second sprint so the third obstacle that we encounter especially in a context here in Asia is distance because we very often work with teams in other parts of the world and so many people have talked about distribution already and there's really three things that is key to good collaboration across distance one is that we need to see each other so the video the second is to need we need to see what the other person is saying so screen sharing and the third thing is that we need to work on the same we need to share the work that we're doing we need to work on the same thing in this context I used Skype to talk to Niroka and through the video sharing I used GoToMeeting which is a flexible screen sharing tool to flip the screen back and forth and we used Dropbox to synchronize the files in the background this is a setup that works extremely well if you don't want to wait for keyboard strokes to come back and forth across the world so it's a very good and low friction way to get started with something there are many good tools out there and new tools are coming every day but it's more important to get started than to choose the best tool for the job the last thing about pair programming is that it requires you to build up skills it is a learned ability Niroka and I didn't pair this well the first time we tried it so in order to do that you might want to do experiments with different kind of switching patterns to try out ping-pong programming because it's a great way to practice and learn better ways of doing it and also when you are pairing to not force your idea through but instead be flexible in trying the other person's idea quickly because that way you don't spend a lot of time arguing which many people when they get started with pair programming spend a lot of time arguing Niroka will be back soon or he might not and the last thing when you start doing pair programming you will be extremely tired exhausted it's really tiring like for real for a week or two it will be the hardest week of your life but after that it will be all fun a good way to get started is when you are sitting down on a fixer bug and you don't know exactly what it is ask someone who knows the technology or knows that part of the code to come over and help train with someone there you can do training events I noticed there has been a code retreat in Bangalore many years there was a C42 organized one just a couple of weeks ago this is a code retreat we did in Sri Lanka two years ago it's a great way to practice programming to get to know more people and to learn how to do pair programming and what we did now is called a coding culture which is a practice form so you work on the same problem over and over again to get better so this is how you get started you create a Dropbox account if you don't already have one you share a folder on Dropbox with a friend you put a coding project there you create a screen sharing session you call up your friend and you share the screen with him and you share the code with him and then you can do ping pong like this and a final way to get started is to set aside a time per week to sit down and do pair programming the one thing I would like to say is don't look around too long for the perfect tool I've given you one tool if you don't have any other tool that you know will work then try that out and then find better tools as you go along and just get started so to conclude my talk what is pair programming? pair programming is two people working at the same code base it is no team member owning a task beyond the day that they're working on so we rotate on the tasks and it's about team rotating pairing that's when you get that effect where you have the team where everybody gets help and everybody starts becoming seeing the big picture with pair programming you get less overproduction because you don't make that unused API that the other people weren't going to use anyway you spend less time waiting for the person who has the right skill you spend less time doing silly things with your tool because you learn from each other how to use your tools better you have fewer defects as two eyes see better than one you do less of extra work because people don't know what the other person was doing so they do it twice you have less unfinished stuff because the team can work on fewer features and get done with those faster and you have less handoffs between team members as you try and develop something so does anyone recognize this list here? very good chocolate for you so these are the seven wastes of lean and these are the seven wastes of lean applied to pair programming ask for help don't work alone play with ping pong programming and just set aside two hours with a local friend or remote friend to work on a problem with ping pong programming to learn new things and sharing your knowledge with your friend so I think you were first and so we'll take away this a team crazed together what no member could do alone the winners or who wants to fight for the prices come up here after the talk so a team crazed together what no member could do alone and that's how I define a team thank you found if anybody has questions or if anybody wants to pair program with me for the rest of the conference and grab hold of me thank you all