Thursday, February 21, 2013

WinRT - Coding in XAML vs HTML5

WinRT has so many choices for developers in term of language for Windows Store app development, that you have to really think which one is better (if not the best) among the all equals.

Functionality wise there is not much difference, all of them ( C++, JavaScript & HTML5, C# and  XAML) runs on the same run time (theoretically) i.e. WinRT. But every language projection has its own set of advantages and disappointing in the context of app you are developing. For example HTML5 and JavaScript can be a bad choice, if your application need 3D rendering of images similarly XAML can be very painful is your dealing with lot of HTML content.

I have listed down some basic guideline which can help you decide between XAML (.Net developers Favourites) and HTML5 (the game changer)

  • Learning Curve: There is a famous saying "A sword never kills anybody; it is a tool in the killer's hand", so if you have to make a choice, consider your team strength in terms of XAML vs. HTML5.  If you are starting with a clean slate then in my opinion HTML & java script is quick to learn as compared to XAML, but this does not mean that you should ignore XAML, because if it benefits you in long run you might still want to spend that extra time in learning XAML.

  • Use Case : If you know that you are going to deal with lot of HTML content and RSS feeds, then HTML5 should be the way to go, XAML webview has many issues and is not as efficient in handling HTML content. And you might want to consider XAML if you dealing with lot of animation and 3D rendering
  • Portability: If you considering porting your application to other platforms outside Microsoft eco-system like iPhone and Android HTML5 will be your friend.  However if you do not have any plans for migrating/porting this app outside Microsoft platform ( and not dealing too much with HTML content) XAML might be a better choice because of rich tool set support like Blend and VS.
  • Maintainability: XAML and C# being the first class citizens of .Net framework has better support for debugging in Visual Studio and Expression blend.  And since C# has support for OOPS your code will become much cleaner to maintain and debug while maintaining huge set of JavaScript file can be very error prone and tedious task. So if your app tends to grow and need on-going support and feature enhancement you might want to consider XAML & C#.
  • HTML5 and JavaScript (WinJS) does not have support for SQLite, and you have to live with index DB. Based on your need, this can also become one of the consideration.
  • XAML has more controls out of box as compared to HTML5 (WinJS) controls, but this again depends on the need to project

1 comment:

Emad said...

Good insight for a newbie... I will be going with HTML because I want to port to other platforms as well.