What I’m working on right now #1: Estelle
Right now I’m working on two programs for the open source world; one should be pretty handy and the other has the potential to be downright cool; here’s the first one:
Estelle – The music organizer
This is a program that will find all of your music files and put them under one folder organized in any way you choose. Why reinvent the wheel? Because frankly, all of the programs that do this seem to suck. They don’t give you enough control over how they organize, and if it doesn’t work right you’re stuck with a big mess; some of them also don’t handle soundtracks and compilations very well. Estelle has an option to create links instead of copy, so that you can have a working preview of the changes before you commit them, as well as treating soundtracks separately.
I’ve been writing this program for about a year and a half now on-and-off, mainly because I write a lot of it, get tired of it, then rewrite it in another language. Over winter break I rewrote the entire program in Ruby (including my own ghetto TagLib extension library), and it’s working better than it ever has. Right now I’m working on a GTK+ user interface, and I’ll also most likely make it an Amarok script as well. The code is only in SVN right now, the command to check out is:
After rewriting my application again, I find in general that it’s just easier to get stuff done in Ruby than it is in C# and Boo. Of course, it depends on the problem and how much library support you have but all in all, Ruby makes application programming less of a pain.
Read on to see some line comparisons between C#, Boo, and Ruby:
Just for curiosity’s sake, I ran wc on the three versions of my program, trying to show how many lines it takes to achieve the same level of functionality:
Original in C#:
366 1095 11348 ./src/mainWindow.cs
90 250 2391 ./src/Main.cs
26 70 637 ./src/Config.cs
308 1031 9982 ./src/Utility.cs
32 130 1067 ./src/AssemblyInfo.cs
180 598 5634 ./src/FormatParser.cs
201 711 6444 ./src/ConsoleHandler.cs
176 588 5586 ./src/MusicInfo.cs
7 20 140 ./src/Globals.cs
73 158 1634 ./src/AlertEntryDialog.cs
123 443 3753 ./taglib/Reader.cs
94 236 2124 ./taglib/File.cs
51 119 1175 ./taglib/AudioProperties.cs
30 80 638 ./taglib/Object.cs
160 339 3053 ./taglib/Tag.cs
1917 5868 55606 total
Rewrite in Boo:
219 1006 8916 ./backend/MusicLibrary.boo
32 191 1685 ./backend/Config.boo
162 775 6193 ./backend/FormatParser.boo
48 271 2288 ./backend/Platform.boo
268 1129 10506 ./backend/Utility.boo
60 280 2593 ./backend/Main.boo
115 504 4167 ./backend/Reader.boo
98 435 3667 ./console/OptionParser.boo
33 201 1997 ./console/AssemblyInfo.boo
102 477 4343 ./console/ConsoleHandler.boo
70 350 3158 ./console/CommandLineOptions.boo
1207 5619 49513 total
2nd Rewrite in Ruby:
160 533 4623 ./main.rb
76 309 2827 ./taggers/taglib-ruby.rb
174 663 5622 ./library.rb
47 220 1959 ./formatparser.rb
107 439 3591 ./song.rb
564 2164 18622 total
So in summary:
- C# – 1917 lines of code
- Boo – 1207 lines of code
- Ruby – 564 lines of code
