{"id":61,"date":"2006-09-16T18:03:07","date_gmt":"2006-09-16T08:03:07","guid":{"rendered":"http:\/\/www.doolwind.com\/blog\/?p=61"},"modified":"2006-09-16T18:03:07","modified_gmt":"2006-09-16T08:03:07","slug":"pair-programming-%e2%80%93-try-it-now","status":"publish","type":"post","link":"https:\/\/www.doolwind.com\/blog\/pair-programming-%e2%80%93-try-it-now\/","title":{"rendered":"Pair Programming \u2013 Try It Now"},"content":{"rendered":"<p>For only the 5th time in my life as a programmer I took part in some pair programming this week.\u00a0 I had forgotten just how much benefit there is from pair programming and decided to share some of my experiences.\u00a0 Pair programming simply means two coders, sitting down at the computer together with one person typing and both people discussing everything they do.\u00a0 Below is a list of reasons why I highly recommend everyone tries pair programming and adopts it as a part of their best practices.\u00a0 While there isn\u2019t a need to do it all the time I\u2019d recommend trying it next time you are designing a large system or trying to solve a complex problem.<\/p>\n<p><strong>1.\u00a0Building Mentor-Prot\u00e9g\u00e9 relationships<\/strong><\/p>\n<p>For this to work, you generally need to have programmers of differing years of experience working together.\u00a0 The more experienced of the two should be the one actually coding and they can discuss and talk through the decisions they make as they code.\u00a0 Programming is generally a very solitary activity and I\u2019ve found watching someone else with more experience to be invaluable as there\u2019s only so much you can learn from a lecturer, text book or self-teaching.\u00a0 Actually watching a master in the art of programming work their magic will give a lot of insight into where the prot\u00e9g\u00e9 is going wrong and will help to build a relationship where they will feel more comfortable approaching the mentor to ask advice.\u00a0 Simply sitting down and explaining to someone the good practices in programming can sometimes seem arrogant but watching someone code is far less confrontational.\u00a0 There\u2019s usually a lot of ego involved with coders and I\u2019ve found pair programming a way for more experienced programmers to dispense their knowledge without stepping on someone\u2019s ego.<\/p>\n<p><strong>2.\u00a0Two heads are better than one<\/strong><\/p>\n<p>This benefit is more for the project than the individuals.\u00a0 If there is a particularly complex or difficult problem that needs solving, it\u2019s often good to have two people working together to solve it.\u00a0 Rather than just discussing the problem, where ambiguities can creep in, having two people write the actual code means any misunderstandings can be cleared up as they write.\u00a0 The code is the final.\u00a0 Opinions, prejudices and communication problems just don\u2019t exist within code; it\u2019s the final contract for what the program will do.\u00a0 Pair programming is also continuous and instantaneous, where sudden ideas that flash to mind can be discussed and implemented on the spot.<\/p>\n<p>Some people may argue that it\u2019s a waste of programming resources having two people do one person\u2019s job, however I believe the benefit gained when working on complex or difficult problems far out ways the cost.\u00a0 You really can\u2019t put a dollar figure on having a better solution to a problem and while the time taken to write code won\u2019t be half as much, the quality will often be high enough to warrant this higher expense.\u00a0 The cost does mean that I wouldn\u2019t recommend pair programming all day long as simple problems can often be solved by one person more easily.<\/p>\n<p><strong>3.\u00a0Sharing specific knowledge<\/strong><\/p>\n<p>One of the biggest benefits from pair programming comes from the fact that every programmer is different and have different experience and knowledge in different areas.\u00a0 Because of this, when two programmers sit down to create some code together one of the two will generally have more experience in the area and can share this experience with the other person.\u00a0 This is similar to the mentor-prot\u00e9g\u00e9 relationship however it\u2019s at a lower level.\u00a0 Despite the overall experience of either programmer, the person with the most knowledge of the particular domain should lead the way and share their knowledge with the other person.\u00a0 If someone has written a number of implementations of the A* search algorithm then sitting down with another programmer and implementing a slightly different one for their current project will help that person share their specific knowledge.<\/p>\n<p><strong>4.\u00a0In with good habits, out with bad habits<\/strong><\/p>\n<p>The act of having someone else watching your every move increases your awareness of bad habits you may have.\u00a0 Better yet, if you aren\u2019t aware of them, the other person can tactfully let you know of a better way of doing something, or that what you\u2019re doing is just plain wrong.\u00a0 On the other side you may find particular good habits that you can pick up from the other person.<\/p>\n<p>So there are four simple reasons why I think pair programming is something you should at least try to see if it works in your given situation.\u00a0 I\u2019ve had only good experiences with it so far and I\u2019d like to hear from anyone else either for or against the practice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For only the 5th time in my life as a programmer I took part in some pair programming this week.\u00a0 I had forgotten just how much benefit there is from pair programming and decided to share some of my experiences.\u00a0 Pair programming simply means two coders, sitting down at the computer together with one person <a class=\"more-link\" href=\"https:\/\/www.doolwind.com\/blog\/pair-programming-%e2%80%93-try-it-now\/\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[33,6],"tags":[53],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-game-development","category-general","tag-pair-programming"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgEc5-Z","_links":{"self":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":0,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.doolwind.com\/blog\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}