Thursday, January 10, 2013

Battle of the languages (Python vs C#)

Some hard thinking last week: Will I build oswos.net in Python with Django, or build it in .NET.

Since I want to host the majority of my websites on my own server to save some money, I need something that works blazingly fast on a slow atom processor (9 watt Samsung NC10 netbook).



The first choice for me was to go with Windows 7 and IIS7, build websites in MVC4 and deploy them to the netbook. After building a new (rather simple) website, the warmup time was ridiculous (15+ seconds). So that isn't an option (my websites aren't that often visited so the site are kept in memory).

Then I looked into Python with Django, hosted on Debian with nginx. Blazingly fast (20ms for a request), the downside is I don't work with Python, but work for 8 hours a day in .NET, so it will take a lot of effort learning it, and at the same time miss the opportunity to get even better in .NET. Specialization is always better than globalization (in development, and in the general meaning of the word!), so my preference was doing something in .NET.

And then it happened: I follow my friends from NancyFx on Twitter for a while now, and about 2 weeks ago I saw them tweet about Mono (.NET for linux), so I wanted to try that. With A LOT of help from http://humblecoder.co.uk/blog/2012/01/07/hosting-nancy-on-debian-with-nginx/ I was able to build mono on my server (took more than 2 hours...) and run it on Debian. Results: Request take about 60ms. Wow!

So my conclusion is, do what you are best at, in my case .NET and make it as fast as possible. In the upcoming week I'll be helping NancyFx with making a tutorial running Nancy on Mono. Once completed, I'll send an update here.

Another thing I wanted to share; I got push notifications working on Android, really simple, look at GCM :-)


Follow me on twitter for faster updates and if you have any questions, or comments.

Take care,
Luuk