I was just wondering if there are any major advantages or disadvantages to using either XAML/C# or HTML5/JavaScript for Metro Apps.
6 Answers
As a little background, I built the American Airlines Windows 8 app in HTML5. I have to say it was fantastic.
First, drop all your ideas of HTML5 as it relates to mobile apps. In Windows 8, JavaScript is a first class native language. You have access to all the hardware features that a XAML app would. There are also fantastic templates built into Visual Studio 2012 for WinJs applications.
WinJs is not just some half thought webview implementation. Microsoft is finally showing JS the respect it deserves.
I would suggest getting up to speed with the latest and greatest in IE10. Honestly that is the core framework for all of the WinJs stuff. It is powerful and fast!
Also, here's a great place to get started with WinJs: http://msdn.microsoft.com/en-us/library/windows/apps/br211385.aspx
The future looks bright for JS as a native language for Windows.
-
4Firstly JavaScript is a script language not a native language. (Unless I missed something and it is now directly compiled into machine code). Secondly it is not a first class language in Win8, since it is meant to be used to develop Metro apps, not any apps (desktop apps, DirectX 11 games etc.).– DenJul 12, 2012 at 8:06
-
3'Cut the Rope' is a carefully picked poster child. Notice it has relatively small amount of things happening at the same time. If it had hundreds of sprites as modern desktop games tend to it would struggle to show decent FPS running on JS.– DenJul 12, 2012 at 8:10
-
2Hey Den - your comments don't seem add to the discussion. Are you saying that because it's not compiled into machine code that it wouldn't be good to use for metro apps? To your second comment about Cut the Rope, you wouldn't write a "modern desktop game" with lots FPS in javascript or XAML, so I think that's irrelevant to the discussion. Jul 12, 2012 at 12:48
-
1Phillip, you said "you wouldn't write a "modern desktop game" with lots FPS in javascript or XAML," is it possible then to make a modern game for Windows 8 devices? And if so, will modern games be limited to Intel devices since ARM devices only support WinRT? Jul 12, 2012 at 15:53
-
1@PhillipBurch: my point is that "native", "first class", "powerful and fast" is a misleading choice of words. And I would most certainly consider using C# + SharpDX/MonoGame (not XAML of course) for developing high-performance games for Metro (ARM is a different story though).– DenJul 12, 2012 at 21:26
Both. Because both are being adopted by developers (though not at the same time, what I mean is while some devs are using XAML/C#, some others are using HTML/JS). For those coming from a Web app dev background, it's easier to transition to HTML/JS. And for those aleady familiar with XAML through WPF and Silverlight, it would make sense to carry over the skills to XAML+C#. And as far as results are concerned, both technologies are showing good results. So my guess is both would be equally good in the years to come.
Metro Apps built using the HTML5/JS APIs will probably be classified as "simpler", compared to their C#/XAML counterparts. While the former will certainly be capable of creating functional, well designed apps, there will undoubtedly be a limit to the capabilities of an app built in HTML5. On the flip side, while C# might be more capable, it's also more complicated. An HTML5 app will be very easy to design and maintain, comparatively.
At least, that's my best estimated guess. I don't have experience developing Win8 apps (yet).
-
3I don't think this is the case. They both have access to exactly the same APIs in WinRT.– IanJul 12, 2012 at 5:01
Both are going to run on WinRT (aka trimmed down version of Windows 8 which is used on MS Surface device).
It will totally depend on developers preference . Thus, developers with HTML5/JS experience will be equally powered to develop for Window 8.
-
WinRT is NOT "Also Known As" Windows 8. It's a stripped down version of the full-fledged Windows 8 OS that runs only the metro ui/apps and works on ARM based tablets. Dec 5, 2012 at 18:02
-
Yes, windows 8 is not a Win RT. However, if that was the meaning that you get from reading my answer, i have made that statement more explicit.– YusubovDec 5, 2012 at 18:33
Yes, in most cases, JavaScript is a native language. Depending on where it's running, its compiled (JIT Style) into machine code.
For example, if you're running the Chrome browser, the V8 engine does just that which is mentioned above. It's my understanding that IE 10 is doing the same, as with the other prevalent browsers which support the ECMAScript 262 standard.
Entou, in most cases JavaScript is no longer an interpreted language. It's a full-fledged, Object-Oriented, Prototypal-based, client/ server-side, ubiquitous programming language.
Not a MS programmer - From a programmers standpoint, it would be worth investing your time and effort in a platform agnostic, open standard like JS + HTML 5. The knowledge you gain can be re-used elsewhere.
Win 8 supports JS natively, so there wouldn't be much you cannot accomplish using it.