Mono, and why it's awesome
Introduction
If I were ever asked which open source projects I thought were the most important to the open source community, I'd answer these three: Mono, Samba and Wine. Now why, would you ask, did I name three projects that are heavily aimed at things that are originally from Microsoft? I'll tell you why: It's because they demonstrate the flexibility and the ableness of the open source community to help people migrate, to adapt to changes in the industry and to take something and make it better. In this article, I will explain to you why I think Mono is one of the most important projects for the continuing existence of open source.
Adaptability
Let's face it people, the two most wanted fields in IT currently are professional Linux/UNIX server and network maintainance and developers for Microsoft's dotNET framework. And to be honest, Microsoft actually has done a good job developing this. Yes, I said it, so sue me. I like the idea of putting a lot of useful functions together and bundling them with a new, object-oriented, programming language. It enables you to use those functions instead of wrapping your own around the (sometimes incredibly overcomplex) built-in functions, which in turn helps the developer writing code faster and making the code cleaner and easier to read. Whereas C or C++ would say:
#include <stdlib.h>
C# will say simply this:using System;
Now be honest, which one of the two appeals more to you? The compiler directive include or the latter, which actually somewhat resembles a sentence. I'm not the only one who things frameworked languages are the future. The folks over at Novell thought so too, and namely Miguel de Icaza. You may remember him as one of the guys behind the Gnome Desktop. De Icaza started developing a free, GPL-licensed, implementation of dotNET, or more accurately, an implementation of Ecma 334 and Ecma 335. Because Microsoft submitted C# and the CLI for standardization, there was no legal problem reimplementing it in an open source version. And they did well, although dotNET 3.5 actually is out and they are still somewhere between dotNET 1.1 and 2.0, some beautiful apps have already been written in Mono C#. For example, the last.fm-supporting music player Banshee and the very useful F-Spot photo-organiser. This was also thanks to th excellent support for GTK+. And this, dear reader, demonstrates the adaptibility of the open source community: If it's good and useful, we'll make it better and use it. There even is an open implementation of SilverLight, named Moonlight.
Beauty
Now don't be scared of a little code. I'll take you by the hand and show you how beautiful code can be when written in C# :). Here we have a little example program:
What this program does is so obvious it isn't even funny: It asks for a string, you type one, and it reverses it for you, giving you the result. On the other hand, this piece of code wouldn't be that obvious in a less frameworked language such as C. I don't even want to imagine having to write this in C. It would mean having to write my own substring function, because that isn't native there, I never seemed to master the scanf function to read from a line and even worse, the pointers will surely make life hard for me. DotNET has built-in support for all these, so I don't have to worry about low level memory poking, allowing me to get straight to the actual code. The Console.WriteLine function even takes care of the line-ends. And isn't this true programming? When I'm done debugging something, the least I expect is that I actually understand what I've done wrong, but when pointer A screwed over pointer B (which actually happens a lot these days, when I code C), you might as well be talking Japanese to me. On the other hand, C# still maintains a very solid image to me because of it's nice object-oriented architecture. This gives me the idea of being in control of the language itself. For example, you can define operators that can be used on classes you create yourself.
Usability
And to finish this cheesy triumvirate, I'll feature Mono's usability. One of the main advantages is that, if you want, you can develop for three platforms at once. That's right, three! Mono applications will run natively on the dotNET interpreter on Windows, and Mono itself will take care of the Linux/UNIX and Mac OSX platforms. Ofcourse, if you want to run GTK#-based applications in Windows, GTK#-bindings for Windows will need to be installed. But all in all, pretty usable, eh? Also, the awesome MonoDevelop IDE helps you in rapidly developing applications. Among other things, it has built-in documentation about the API via MonoDoc, support for deploying packages in binary and source format, an awesome Scintilla-based source-code editor and last but certainly not least, it supports GUI-design via Stetic. You can even add signal-functions with a click of the mouse. The possibilities with this program are endless.
Epilogue
The progress the Mono project has made in such a relatively short time makes developers like me happy, very happy. Now, when I have an idea for a program, I'll be sure to write it in C#. I will have no trouble designing it, for I can focus my mind on making the actual algorithm of the program, instead of having to bother with pointers and the like. Mono is important to the open source community because it is a version of a very good framework within an even better community. Because when I'll be writing applications commercially, I'll be sure to recommend Mono to my superiors, not only to save money, but to support this awesome incarnation of the dotNET framework. There is only one downside though, and it's very ironic: I finally discovered the Promised Programming Language (yeah, really), and now I don't know what to write in it. Grmbl.
Whoa.. should any layman get this as well, since that little code did too scare me? ;)