Wednesday, September 28, 2011

.NET is more open than Java

There has always been this stereotype that Microsoft are sworn enemies of open source and Java is uber cross-platform. Well, guess what, that's not true and the proof came in April 2010. I know that this is about a century ago in software years but for some reason the news have gone past me and I'd hate to not comment on that - be it regretably late.

The story goes as follows - after acquiring Sun (and the Java technology along with it), Oracle decided to sue Google over their use of Java on the Android OS (source), basically redefining 'cross-platform' to mean 'running on any platform that Oracle can make money out of'. The fact that Java had a chance to become the de facto universall development environment for mobile devices doesn't matter.

In the same time Microsoft have this thing called Community Promise, which basically means that they are OK with you implementing a .NET environment on any platoform, and more specifally - it means that they won't pull the same stunt about .NET on Android (source, and yeah, .NET development on Android is possible - ).

Now let's get in the time machine and travel back to present day. It's already October 2011 and in the meantime Android has become the dominant OS for smartphones, and Novell have been acquired by Attachmate and along with it - the Mono and Mono for Android team (Ximian, the company that originally developed Mono was acquired by Novell), followed immediately by Attachmate dumping the Mono and MonoDroid teams - a truly disturbing development for the .NET and mobile development communities. However, a large part of the team that originally created Mono now formed Xamarin - a company that is committed to supporting and advancing this family of products, and they have reached an agreement with Attachmate to be the official stewards of these projects.

So, Mono, MonoTouch and Mono for Android, after changing hands three times are now once again in the hands of a small, dedicated team, which is of course very promising. We'll only need to see who will get to buy Xamarin next...

I really hope for one thing, though - that it's not going to be Microsoft or Google, or for that matter - any other major player in the smartphone game, as this will lead to Apple immediately blocking MonoTouch on iOS. For the ones unfamiliar with MonoTouch - this is a product that lets you compile .NET applications for iOS, and with HTML5's future being uncertain before 2022 - that's pretty much the only way to run anything that was not orignially written on Objective C on the iPhone and other iOS devices. Now MonoTouch is not a true .NET implementation - it's not CLR, it doesn't JIT and execute intermediate language code - it just compiles .NET to native code.

There were times that the future of MonoTouch was quite murky - there was the infamous point 3.3.1 in the Apple developer agreement that stipulated that iPhone apps must be originally developed in Objective C, i.e. the trick that MonoTouch does was officially banned. But then the ailing Jobbs was apparently struck by a dose of benevolence and decided to let MonoTouch do its thing.

The implications of both developments - now you can develop in .NET on every major mobile platform! Of course it's not as easy as it sounds - as Miguel de Icaza (the mastermind behind Mono) points out himself, you can only really reuse the business logic, you'll need to implement the front-end differently for every platform. Still, you'll do it with the same tools, and will follow roughly the same practiceses.

The topic of cross-platform mobile development with .NET is one that has captured my interest and I will be posting more about it in the future, so if there's anything that you are particularly interested in, or have something interesting to share please make full use of the comments.


Stilgar said...

The community promise covers only full implemntations of one of the .NET profiles. You can have full implementations with additions. This is basically MS's way of saying "as long as our code runs on your platform we're OK with it because we're confident we'll have a better implementation" Java's license allows everyone to implement JVM but it has to be full implementation with no additions. This license is a result of what MS tried to do with Java (and got sued and lost and created .NET) namely extend it in a way that makes it better than SUN's Java. They were hijaking the platform and when SUN open sourced Java they did it in a way that would protect them from hijacking like the one that MS tried. When they implemented Dalvik Google violated both rules. Their implementation of Java does not fully implement any of the Java editions and they've added a lot of Android specific stuff. This is why they will have to pay A LOT if they don't manage to prove that the patents are invalid. Anyway they are thieves.

BTW it is ironic that with MonoTouch .NET actually works on more (important) platforms than Java because Java does not work on iPhone (and WP7 but it is not important yet)

Stefan Kiryazov said...

About the first point - indeed the whole drama started back into the mid-to-late 90s with the so called Java wars. Back then Sun had the utopic dream of having 'develop once - run anywhere', which the not 100% compatible Microsoft implementation prevented.

The most ironic thing in the whole story is who was the leader of the Java team back then - it was Eric Schmidt, currently Executive Chairman at google. So this guy has led the armies on both sides of the Java wars!

About the second point (Java becoming less relevant on mobile platforms) - it's not even ironic, it's plain sad. Sun/Oracle never cared to support an alternative implementation and compiler for iOS and not only that but they seem to have a problem with Java working on Android.