Difference between Metro Apps written in HTML/CSS/JS vs XAML/C#
Asked Answered
G

1

13

What is the difference between Metro apps written in web-development technologies and ones written in XAML/C#, etc.? Does Microsoft Metro API provide hooks for Javascript, where it's all native for C#? Should they work hand in hand, or is it the developers choice which route to go?

Is there certain functionality that cannot be implemented if using JS (other than OpenGL hardware capabilities)?

The reason I'm wondering is to know which technologies are necessary for building extensive Metro apps, so that when I get to a certain point I'm not stopped by a brick wall, letting me know that I used the wrong technology.

Gally answered 28/9, 2012 at 17:18 Comment(2)
Hope the following will help you in taking a decision [Windows 8: Top 10 Reasons why I choose XAML over HTML5 ](blog.jerrynixon.com/2012/05/…) HTML, CSS, and JavaScript features and differences (Windows Store apps) [Metro App: XAML/C# vs HTML/Javascript ](social.msdn.microsoft.com/Forums/en-US/winappsuidesign/thread/…)Gravois
And the counter argument to your first link at codefoster.com/post/2012/05/23/…Asante
H
17

Microsoft has put in a lot of work to make Javascript a first-order language on par with C# for WinRT development. Both Javascript and C# have direct access to the WinRT API via language projections. That is, there is a unique binding specific to the language to the underlying API. So neither language is any more "native" than the other.

You should be able to write an equivalent Metro app in either language. At a high-level, it really does come down to which language/environment you are more comfortable with.

However, there are a couple of differences that should factor into the decision. First, WinRT components can only be written in C# or C++. Javascript can only consume thse components. If there is an intent to create reusable/shareable components, should keep this in mind.

Second, although the Windows Phone 8 SDK has not been released yet, there are indications that Windows Phone 8 apps can only be written in C#. If there is an intent to create similar apps for both the tablet as well as the phone, this is probably a serious consideration.

There haven't been a lot of performance-based studies comparing the two in a Metro app, so it's hard to say whether that will become a factor or not.

Then, there is also 3rd-party support to consider. C#/XAML is well established and has a lot of 3rd-party support. But similarly, Javascript has a lot of 3rd-party libraries available (e.g. jQuery) that for the most part can be brought in and used in a Metro app as well. I would give a slight edge to C#/XAML, but it seems like support is good for both.

Hanna answered 28/9, 2012 at 19:5 Comment(5)
Thanks for the complete answer :). Do you thing that JS support will stay around, or is it just bait to get some new developer interest?Gally
IMO, HTML/Javascript development for WinRT is just going to become further developed and more entrenched as time goes on. Developer commitment as more apps are written will see to that. For Microsoft's part, I also cannot conceive any sort of bait-and-switch coming from them. They have a long hill to climb to establish mobile market share. That means they need to attract developers into their ecosystem AND keep them as well.Hanna
Good point Gambit. They sure have to catch up if they want their Surface tablet and OS to succeed. It seems like they have good ideas, but no follow through..Gally
The only reason I'm cautious of going the XAML/C# route, is due to it's platform dependence. It's so heavily dependent on Windows, and it's almost impossible to write software with using the same code-base for other platforms.Gally
For what it's worth, Microsoft has made many public statements about how much it loves JavaScript and the web stack and their business decisions (beyond just JS in Win8) reflect that. The power of the Win8 architecture is the fact that multiple language stacks can be used. In fact, there's nothing to say another projection couldn't be added on later to expand even further.Asante

© 2022 - 2024 — McMap. All rights reserved.