An adventure in Open Source contribution

by davidnielsen

I’m now officially a contributor to Banshee.

While I have done a lot of advocacy work and packaging, this is my first ever proper code contribution to Open Source. Coding as such never really excited me and as a result it has been some 5 or 6 years since I last sat down to understand and work on significant code. Even then I never really got deep into programming as specification and design always was more fun to me than implementation.

It all started when a friend buzzed me a presentation by Anders Hejlsberg titled The Future of C#. While I haven’t done much with .NET I have always been impressed by it as technology and I was eager to learn of what new tools would come in the future. Naturally the talk was also attractive to me because one of the features Anders demos (Compiler as a Service) as a coming post 4.0 release feature is in Mono today, something I always like to think about when people say that Mono forever will be “chasing the dragon”. Regardless, the talk got me excited about coding and was extremely entertaining to boot. So I wanted to try something, anything, and since I like Banshee but also see it crashing and being slow a lot as a daily stress tester and bug filer I decided to subject it to experimentation.

In comes the magic of .NET, Mono, and Ubuntu. In Ubuntu I found all the tools I needed, namely MonoDevelop, mono-tools and finally Gendarme. Gendarme is a really cool project that can inspect assemblies and executables according to a set of rules for such things as security, performance and even bad practices. So I decided to run Gendarme on then content of /usr/lib/banshee-1 expecting to see a few hits and probably a lot of false positives. However Gendarme returned more than 8800 issues even on medium settings, so I limited my focus to just the performance rules set.

Gendarmes issue reports have excellent documentation with examples of bad and good code as well as careful explanations, making it easy to pick a simple problem such as the one addressed with my patch. In this case we now determine these variables at compile time rather than at link time which is faster. It is safe to do and doesn’t break external assemblies as the fields are not shown outside. All of which was explained by Gendarme and confirmed on the Banshee IRC channel. Gendarme even explained how to fix the issue, it could not be easier. Bertrand Lorentz was kind enough to sign off the patch and commit it within minutes. As an example the Gendarme article on the issue type my fix addresses can be found here.

Regardless, that was yesterday. Today my Banshee is once again back to being a git build by hand which with the excellent Banshee daily repo hasn’t been required since I stopped contributing to Fedora. The reason is simple, I needed to compile test some more changes as I was reading the Banshee source code and learning. With friendly hints from the existing developer base also growing some basic understanding of what is going on.

Contribution is easy, zero to sixty even, with Mono and Banshee.