Pair Programming > Code Reviews

With the rise in popularity of agile software methodologies, the practice of formal code reviews has been often put against pair programming. There are proponents for both and some even recommend practicing both.

As time goes on, I’ve been able to do a little bit of both and I’ve developed a strong preference for pair programming over code reviews.

With code reviews, you get one or more other persons to review the code you just wrote and feel ready is to be checked in, deployed, or whatever the next step is. These reviews can be very formal or just as simple as a line-by-line walk through the code. The goal is to find any bugs or fixes before the code gets to the next step. This is very analogous to the writer/editor/publisher workflow (kind of like this blog entry). Writer writes the article, editor proofreads, and the article gets published. Programmer writes the code, other developers review the code, and the code gets deployed. It almost seems like the idea of code reviews came out of software methodologies like the Waterfall model. Everything is very sequential and done in distinct stages.

In pair programming, the focus is on developing “good” code the first time around. We do this by having more than one pair of eyes on the working code as it is being written. One person is the “driver” who is writing the code and the other is the guide or observer who is verifying the code being written and thinking of potential improvements. The developers switch roles whenever it makes sense which in many cases causes one developer to immediate use or have to work with the code that was written by their partner. It places emphasis on the idea that two heads are better than one.

Two things come to my mind when I think about pair programming and code reviews. First, code reviews seem to be a just-in-the-nick-of-time fix for finding bugs in code before it goes out the door. The initial development effort as already been completed and now we are evaluating the work. And realistic, this is code we’re looking at. Everyone has their opinion as how things should be structured, design philosophies, coding styles, etc. Many times code review sessions end up focusing on higher level concepts like those previously listed and not on the code itself. These kind of debates are related to decisions that should have been made prior to writing this code. Why are we asking ourselves why we did this this way now after we’ve already spent time and effort to write code for it? And the people part of the code review are not neccessarily the people that will be working with that piece of code.

That brings me to my second thought which is this is all reminiscent of Scrum pigs and chickens.


In code reviews, people sit down to review someone’s code. Everyone has an opinion but not everyone is going to be working with the code on a daily basis. At the time, everyone seems to be involved in the process but there is no vested interest. They are just looking at some code and asking themselves “does this code look good and is it correct?”. It’s a very passive standpoint. On the other hand, pair programmers are completely invested (committed?) in the task at hand. They immediately are using the code they are writing together and collobarating their thoughts on design, code layout, etc. Both programmers are taking on an active role and are emotionally invested in the task at hand because they are attacking the same problem together.

Most of the cons of pair programming can be attributed to developer social/ego issues. And they are not specific to pair programming. Going down the list of drawbacks listed on Wikipedia:

  • Developer egos: Experienced developers may find it tedious to tutor a less experienced developer in a paired environment.
  • Developer intimidation: A less experienced developer may feel intimidated pairing with a more experienced developer which may result in less participation.
  • Developer work preference: Some engineers prefer to work alone, and may find the paired environment cumbersome.
  • Tutoring cost: Experienced developers working alone may be capable of producing code that is clean and accurate at the outset, and the additional theoretical gain from pairing might not be worth the cost of an additional developer. This is especially true when producing more trivial parts of the system.
  • Potential conflict: Differences in coding style may result in conflict, and personality conflicts can result in one or both developers feeling awkward or uncomfortable.
  • Chat sessions: Sometimes employees might talk together too much, straying excessively into off-topic subjects, such as major news events, personal problems, etc.
  • Annoying personal habits: Sometimes people can find each other much more annoying when working up close than at separate workstations.

Developer egos, intimidation, work preference, and tutoring costs are things that should be checked at the door. As an experience developer, you should look for opportunities to help your fellow developers to learn and improve their skills. As a more junior developer, the opportunity to take chances and try to prove yourself is one of the best ways to learn and develop better skills. I don’t know about other people but collaborative work environments seem to be a plus. Being able to discuss your ideas openly is one of the best ways to make what you’re building better than it is. As for potential conflicts, chat sessions, and annoying personal habits, these have more to do with personalities and mannerism in the work place. All of this can happen in code reviews as well but the point is being self-aware and respectful of your coworkers is just as important as writing awesome code.

While I’m not against code reviews, I feel that pair programming is better suited to improve both code and team quality.

Pair Programming > Code Reviews

Eclipse Ganymede + Subclipse = Unable to load default SVN client???

I like Shiny New Things. So when I heard Eclipse Ganymede SR1 was available, I proceeded to replace the Stream Stable Build I was currently running.

This, of course, ended up causing me problems. After installing Subclipse and attempting to pull up any SVN history, I get an error dialog box that states:
“Unable to load default SVN client”

Confused, I RTFM and saw that “Subclipse 1.4.x requires Subversion 1.5.0 version of JavaHL/SVNKit”

Seeing the SVN I was running was in fact not 1.5,

  theo@notedpath~ $ svn --version
svn, version 1.4.4 (r25188)
   compiled Nov 25 2007, 08:20:33

I went here, downloaded and installed Subversion 1.5, restarted Eclipse and things are looking good now.

Stupid shiny new things.

Eclipse Ganymede + Subclipse = Unable to load default SVN client???

Surprise your users

With the launch of Chrome today, the net is all the buzz around how great Chrome is/can be. But this isn’t yet another post about chrome.

This is about me wanting to track the flight status of my parent’s airline that just came in from Cali. Of course I could go to the American Airlines website, which by the way is at aa.com, but that seemed like a lot of work when Google is my default homepage. So I thought I would just type in the flight information and hope Google would give me a direct link to the flight status page.

search

Google’s response surprised me with the following:

search-result

Wow. Thanks, Google!

Surprise your users

gem update fails – can’t find header files for ruby

So, Pat got a new MacBook Pro. Little does she know, I’ve start to install programs that I would use if I just so happened to be on her computer. The laptop already had Leopard installed and all of its goodies but a bit of upgrading was called for. So, of course I had run gem update.

pats-macbook-pro:~ pat$ sudo gem update

Updating installed gems

Updating RedCloth

Building native extensions.  This could take a while...

ERROR:  While executing gem ... (Gem::Installer::ExtensionBuildError)

    ERROR: Failed to build gem native extension./System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb update

can't find header files for ruby.

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/RedCloth-4.0.3 for inspection.

Results logged to /Library/Ruby/Gems/1.8/gems/RedCloth-4.0.3/ext/redcloth_scan/gem_make.out

But then I ran into a strange error I had never seen before. gem update would fail when trying to build native extension. It’s been awhile since I setup a rails development environment so a-googlin’ I went.

Turns out the ruby headers don’t come installed with the base ruby install with Mac OS X. These can been found on Mac OS X Install Disc 2 by installing the XCode Tools.

Once installed, all was well!

gem update fails – can’t find header files for ruby

In search of a back up solution – Mozy.com

I am in search of a good automated backup solution for my personal computer(s). Previously, I’ve just uploaded important files I want to keep onto my slice or some web hosting site. I also use a 250GB Western Digital External HD to backup pictures and mp3s.

But now, I want an online solution. I want a service where I can “set it and forget it” to back up any or all the files on my multiple computers. My first stop was at Mozy.com. I downloaded their Mac installer, which had the BETA description next to the download link.

The install and setting up it to start backing up some files was easy. The free 2 gigs for MozyHome is great. But when I really got into customizing what I wanted to back up, I was disappointed. I could not easily place rules to ignore certain files and folders. It was all or nothing. Also, Mozy takes the term “backup” very literally. If you delete the file off your local machine, Mozy will delete the file from their backup servers in 30 days. It is not intended to be used as a file repository. You can’t easily share your backup files either.

mozy-1 mozy-2


For $4.99/month, I can get unlimited backup space. But without being to easily exclude certain files and folders like .DS_Store and .svn folders, Mozy is a no go for me.If anyone can recommend something better, that would be super.

In search of a back up solution – Mozy.com

KML – the new mapping standard

The Open Geospatial Consortium just announced that KML has been adopted as an open standard. KML stands for Keyhole Markup Language, originally designed by Keyhole who was acquired by Google back in 2004. Keyhole’s Earth Viewer product was reborn as what we know today as Google Earth. I first came across KML when I was working on some data visualization using Google Earth. I found it to be very expressive and easy to use. You can do neat things like stream dynamic KML to animate the map or add overlays on the map.

It’s interesting to see how Google Earth/Maps’s popularity has allowed KML to become the international standard. It will be even more interesting to see how quickly the standard is adopted by many of the geo-visualization products out there. While I don’t think it will be “the HTML of geographic content“, I do think this standardization will open up the market for new products that build/support KML, pushing KML to its limits as we have done with HTML.

KML – the new mapping standard

Google App Engine Launches

Google App Engine, which acts a Google-hosted application platform powered by Google technologies like BigTable and GFS. You can read more about it here. I was lucky enough to get an invite to try it out. Right now it only supports Python, but they say they plan on expanding this to other programming languages. I hope that’s true. I never really played with Python but this might give me more incentive to take a closer look at it.

Anyways, going through their Getting Started documentation took about 10 minutes. All of the apps are hosted at the appspot.com domain but from the Admin console, it looks like you can have your use your Google Apps domain which is pretty cool.

Check out what I got so far at: http://notes.appspot.com

Google App Engine Launches