Sunday, February 24, 2008

Lucid Dream Journal Project

In my free time, which seems to be dwindling lately, I have been working on a cross platform dream journal application to aid people with lucid dreaming. If you don't know what lucid dreaming is, head over to ld4all or dreamviews and get yourself caught up. You'll be glad you did. This post is not about the application specifically, as only the core is finished and the user interface is just starting to shape up. The details are for another time.
I'm going to talk about the general structure of the application in case anyone is interested.

I have taken a route that most, if not all software design classes (at least the ones I am familiar with) stress, similar to many other projects. The core functionality of the application is built as a library, and is as coupled as loosely as possible to the user interface. This is of course, partially because I am as of yet undecided of which toolkit to use to implement the interface. However let's pretend that it is all for the sake of good software design ;). I've narrowed it down to the FOX Toolkit, or Ultimate++. Both are well established, free and open source. If anyone has any thoughts of why one is preferable, feel free to share your thoughts.

Wednesday, February 20, 2008

Distributed Code Management with Mercurial

I've been pretty busy the last few weeks and it will probably remain that way for the foreseeable future. Unfortunately that means my more detailed reviews of different revision control systems will have to be delayed. In the meantime for those interested I'll explain the basics of a workflow I've adopted on a few projects using Mercurial. Please keep in mind that you can use this method with most, if not all, of the current distributed revision control tools.

Since I have more experience with revision control tools than others in my team ("more" being "some"), I decided to set up a repository to help us manage our code and documentation. However, I'm not a fan of leaving my computer on all the time due to little details such as...the electric bill. The workflow we have been using is pretty simple. There is a master repository on my desktop, which is turned on in the evenings. When people make a change to the repository, they create a "bundle" file, and e-mail it to me with a certain subject.
The command in Mercurial is:

hg bundle --base [base revision] -r [end revision] [bundle file]

The desktop monitors the e-mail account for messages with the appropriate subject from a list of approved senders, and checks for the attached bundle file. If it exists, it is downloaded and applied to the repository. Merge conflicts are handled manually as usual. Once the new changes are successfully merged, a new bundle file is created and e-mailed to everyone so they have an up-to-date version of the repository.

While this may sound overly complicated, from a usage standpoint it is pretty simple and works well in practice for small groups of people. There is also the added bonus of enabling people to exchange changes with each other directly without going through the main repository, thus improving the quality of the main code. I agree that giving everyone SSH access to push/pull changes would simplify the process, however that is not an option for us, plus it would be boring ;).

Sunday, January 27, 2008

Distributed Version Control Comparison

After reading about several new distributed revision control tools over the past several months, I’ve been testing some out (actually, most of them), and a few have caught my interest: Mercurial, Bazaar, Git, and Darcs.

I seem to have settled on Mercurial for now, as I’ve been using it for both school and personal projects over the past few weeks. However, all of these tools have facilities to make conversions between them possible, and even easy (NO WAY!), in some cases. In addition, they also all have support for reading from Subversion repositories. If I happen to change my mind next week I can convert my repositories to another format and use another VCS, which is pretty cool. I’ve broken down the main differences between these tools below, however don’t worry, I will post a more detailed review sometime next week.

Mercurial: Written in Python and works equally well on both Windows and Linux (apparently under other systems as well), and is used by projects such as NetBeans, Mozilla and OpenSolaris. The UI is well designed and the commands are easy to get used too, especially if you have used Subversion or CVS (if you are still using CVS for the LOVE OF GOD upgrade to Subversion!) before. The output is completely customizable, which makes it perfect for scripting, and it includes all the repository hooks bells and whistles. My personal favorite.

Bazaar: Smaller market share than Mercurial or Git, but I have very few complaints. It is used by Canonical Ltd. to manage the Ubuntu linux distribution, and works great under both Windows and Linux. It does seem a tad less responsive, but not by much, and the performance improves with every release. Bazaar also has direct support for the “centralized” version control model (a la Subversion/CVS/Perforce, etc), which saves you an extra command if you use that model for a project. (In Mercurial/Git/Darcs you need to do an extra “push/pull” to communicate with the “central” repository). The conversion tools are also excellent.

Git: Originally made of up several C programs stuck together with bash and Perl scripts, this tool adheres to the UNIX philosophy of using several small tools, with each one doing one task really well. Git has since evolved to be a great VCS, and is most notably used to manage the Linux kernel. The main shortcoming is its lack of Windows support. It will run with Cygwin, but that is not an option for the average user. If everyone involved in the project uses Linux, Git is definitely worth a look. There is also a great interface for communicating with Subversion repositories, git-svn.

Darcs: Written in Haskell, and uses a “patch algebra” for changesets to make merging easier. Performance is on par with the rest, although I’ve heard of a few cases where a merge can take hours where it should have taken seconds. However, Darcs is still in its early stages and has some interesting ideas. Like Git, it does not work well in Windows, but for some people that is not an issue. I wouldn’t trust it with a corporate project, but definitely worth a look.

While you’re waiting for the more in-depth reviews, check out these other comparisons:

http://www.dribin.org/dave/blog/archives/2007/12/28/dvcs/

http://www.jukie.net/~bart/blog/git-vs-hg

Enjoy!

Wednesday, January 16, 2008

I'm back!

So, as you can see from the title, I'm back. Hopefully with regular updates for a while now. I've got some side projects in the initial planning stages, and some interesting classes this semester. Stay tuned. Or Don't. Your Choice.