Over the past weeks I have written about the open source project robocode and my adventures with programming my very own robot. On top of this, my previous blog entry details my experiences with using automatic Java build tools. One missing ingredient to this awesome method of coding is centralized code hosting. In this case, Google Code hosts my WallRunner robot’s source code so that anyone could potentially download and extend the capabilities of WallRunner.
TortiseSVN client has a graphical user interface such that the actually subversion commands are not necessary to download source code. As such I had to provide TortiseSVN with a source download link. At first I did not realize that there existed a space between the link and robocode-pmj-dacruzer, so when I provided “https://robocode-pmj-dacruzer.googlecode.com/svn/trunk/ robocode-pmj-dacruzer” to TortiseSVN the source code failed to download. By removing “robocode-pmj-dacruzer,” TortiseSVN downloaded the source code with ease. Once over this trivial matter, importing this project into Eclipse was a breeze since subverion downloaded everything in the project trunk; even the Eclipse’s project and class path files.
At first I found the idea of “update” and “commit” to be strange vocabulary for the actions of downloading and uploading, but this word choice is vital to subversion’s capabilities. Not only does subversion download the hosted source code, but any lines of code not found in the local code are “injected” into the local code. In this way, none of the updates done to the hosted code are lost between developers. In this sense, “update” describes the latter function quite clearly. In opposition to this, “commit” in a certain way could be thought of as an “update.” On the other hand, “commit” emphasizes that a piece of code will be stored in the project.
A problem that appeared related to committing code to Google hosting. After the first couple of code commits, I realized that I did not write any comments to explain the nature of the commit. Although these commits are insignificant in the sense that the project has just been started, it is a good practice to comment on the changes that the commit brings.
I found this method of software engineering particularly appealing because I tend to do my development at home on a desktop computer. Obviously, I am not going to tug around my desktop computer with a 24″ lcd screen, so I have to update my laptop with any code I previously worked on. Before I had used a combination of dropbox or a flash drive to port my code to my laptop. Having to move my files around was clunky in the sense that I may have multiple versions of code; a copy on my desktop, flash drive, dropbox, or laptop. Subversion will allow me to commit code to the project at home, then download a copy of my code during class. As a last note, I am very excited to use subversion to catalyze development of code to the point that I forgot to run “ant -f verify.build.xml” before uploading my sources! =] ( Unfortunately, checkstyle found 2 errors.)