1. Thoughts on Mono and MonoDevelop

    This weekend I have been playing with the Mono framework and the accompanying integrated development environment (IDE) MonoDevelop. I come from the Microsoft world of software development, as I started out with Visual Basic back in the end of the 1990’s and the beginning of the 2000’s. Throughout the past couple of years I’ve spent most of my developing time in Visual Studio working with the ASP.NET MVC framework. Thus, C# is my preferred language.

    As a side project — related to my startup, Mivando — I have been interested in building a local app that allows the user to run a web browser that renders webpages based on common web standards (such as HTML, CSS and JavaScript) plus the Liquid markup language that we use to render dynamic content in shop templates. The purpose of creating such a web browser would be to enable designers of Mivando themes to run and view how Liquid would be rendered in Mivando — without needing access to the Internet.

    Now, a number of options when it comes to cross-platform development seem interesting with Java being a popular choice. But since I am a C# developer, at a first glance, Mono seems much more appealing. So I have spent something like 24-26 hours this weekend playing around with the framework and the IDE. With this blogpost, I will express my initial thoughts on the framework and community around it.

    What is Mono?

    Mono is a free and open source project led by Miguel de Icaza and his company Xamarin. The objective of the Mono project is to create an Ecma standard compliant .NET-compatible set of tools. This includes a C# compiler and a Common Language Runtime. Mono (as well as the MonoDevelop IDE) offers an easy way to get started with developing desktop applications for both Windows, Mac OS X and Linux. Rather than using WinForms, Gtk# is the preferred toolkit for building graphical user interfaces. Off the platter, the drag-and-drop features to creating a nice looking interface and the well-known syntax (C#) make it easy getting started.

    I should mention that I have been developing with MonoDevelop on my Mac (OS X, v10.6.7). I have been using Mono v2.10.1 and MonoDevelop v2.4.2, which currently are the latest versions available. As mentioned, the purpose of developing in the Mono framework has been to create a unique web browser that can render Liquid markup. Thus, my project has involved some external libraries — such as the WebKit-Sharp library (which I have used as the web renderer) and the DotLiquid library.

    Developing with MonoDevelop

    MonoDevelop resembles Visual Studio to a very large degree. This is a very good thing. Despite the fact that I don’t have much experience with programming languages outside of the Microsoft world, I believe that Visual Studio is the best IDE out there. MonoDevelop offers the same benefits, including auto-completion and a version of IntelliSense. Writing C# code in MonoDevelop is probably as fast and as intuitive as in Visual Studio. Thumbs up to the development team behind MonoDevelop.

    MonoDevelop offers a source code-view and a designer-view. This works as you would expect it to if you have any experience with developing desktop apps in Visual Studio. The drag-and-drop features makes it incredibly easy to put together a great looking user interface without writing a single line of code. Each widget of the Gtk# framework can trigger on different events and send signals back to the “code-behind”. Even a 5-year-old would be able to put user interfaces together with Gtk#.

    I spent the most of the day yesterday building my app, which I finally got to work just as I wanted it to on my Mac. The result is a single executable (yes, a .exe file) that can be executed by running the command in Terminal: mono NameOfApp.exe. It is possible to pack the raw-looking .exe file into a beautiful Mac app-bundle by following a few simple steps. Great! Until I tried running my app in Windows and in Ubuntu…

    Porting to other platforms? Huh?

    The band 'afaik' made a song called 'Cross-platform, Don't Hate'To be frank, I had hoped that it would be much easier porting an app to other platforms. First of all, the Mono framework must be installed on the target platform (unless a bundle is made, which I will discuss later). The dependent libraries also need to be installed on the target platform. With these prerequisites in place, the app should work on the target platform. I finished my app and got it working (on my Mac) in the afternoon yesterday. I then spent all yesteday night and most of today trying to figure out how to bundle up these dependencies and create one executable to be distributed. And I still haven’t found a solution.

    I have tried a variety of options with the mkbundle function being the one that has taken up most of my time. Much more can be read about mkbundle in the link provided and by searching on forums (such as Stack Overflow) via Google. In short, mkbundle is a tool that can be run on a Unix system to create a bundle combing the given app with the necessary dependencies (even with the complete Mono framework).

    After many attempts, my conclusion is that mkbundle really does not make my life easier. I started missing my usual Windows platform and Visual Studio a lot. The main problem (at least for me) is that combining assemblies and the actual app into one bundle has been very much of a hassle. I have kept myself busy managing static links as well as dynamic links to assemblies depending on specific versions of the Mono framework and the Gtk# GUI being installed. Ugh! While I am very positive about the MonoDevelop IDE in itself, I have been very sad about the options to make an easy deployment. This is simply missing in Mono in my opinion.

    It might be that I have become spoiled with the extremely easy-to-use NuGet package manager that ships with VIsual Studio as well as the one-click deployment process. But I really do think it is a pity that such a promising and interesting framework as Mono lacks the final step of the process of developing an app. I want to spend my time coding and designing — not hassling around in my Terminal trying hundreds of options to make a simple thing work.

    Mono is really a great framework

    Unfortunately, I think it is obvious that Mono is based on the contributions of many different contributors. While a large number of contributors obviously is a good thing for any project, it costs a lot on the simplicity account, in my opinion. Moreover, the documentation of less popular libraries is extremely scarce and not many forum posts exist on the topic.

    Until May (this year), the Mono project was backed by Novell. But after Novell was bought by Attachmate, all of the developers working on the Mono project were laid off. Now, Mono is officially backed by Miguel de Icaza’s startup, Ximiran. I admire the great work done by de Icaza and the other contributors to the Mono project but it is a shame that no large corporation with the necessary resources stands behind the project any longer.

    Despite some hassle, I will definitely keep on working with Mono. It’s definitely not as complete as Microsoft’s .NET framework and IDE. But, really, what would you have expected? I already love Mono for being the way it is. Also, its features for mobile app development seem interesting and I will definitely check them out. My calendar tells me that I’ve got nothing to do the upcoming weekend. I’m already thinking about what to explore next within the world of Mono.

Notes

  1. sebastianbrandes posted this