Chapter 2
Collaborating with Text Only

Let’s imagine we’ve found a bug in the open source library Backbone.js, a code base that we aren’t very familiar with. We post a tweet such as “Found a memory leak in Backbone.js. Anyone want to #pairwithme and fix it?” Because we used the #pairwithme hash tag, someone with the same problem replies and wants to pair-program with us to fix it. Now what?

We need a way to share the Backbone.js source code and collaboratively modify it with our partner. Many commercial screen-sharing applications and advanced integrated development environments (IDEs) make this possible. But not every programmer will have access to those specialized tools or even enough bandwidth to use them. Because we must quickly connect with a new partner, our collaborative editing environment must be ubiquitous, unobtrusive, and lightweight. We need a terminal-based stack of tools that can share a minimal text-based view of our code. Even if you prefer screen sharing or an IDE, the terminal will always be the most reliable platform for pairing, and knowing how to use it is essential.

Terminal-based tools typically require less bandwidth and handle high-latency networks better than screen-sharing applications. Their primitive nature also makes them more accessible than IDEs because they use readily available platforms and protocols. That doesn’t make them any less useful, though. Programmers at companies such as Pivotal Labs, Thoughtbot, Braintree, and Relevance use terminal-based editors as their tools of choice for remote pairing.[41][42][43][44] The technology underpinning many of their terminal-based environments is tmux.

tmux is a terminal multiplexer that’s used to manage multiple windows, and share editors like Emacs and Vim. We can run a database console, web server, and text editor side-by-side in separate panes. We can also can connect multiple tmux clients to the same session so a pairing partner can see and interact with these windows.

You’ll learn the basics of tmux as we hack on the Backbone.js source code. Backbone is a client-side model-view-controller framework built in JavaScript, and it presents some interesting pairing problems because it runs in a browser, which can’t be shared via tmux. In the process of fixing that problem, you’ll learn how to use tmux with your own projects.

Before we dig into the code, let’s set up our development environment for pairing.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.97.75