locked
Why choose JS/HTML and not C/XAML

    General discussion

  • What are the advantages of using HTML/JS to write a metro app?

    Other languages like VC++ have access to DirectX, and CSharp has some great language features to make coding quicker and simpler. I am having a hard time thinking of a useful reason to use JS/HTML. At first i though i could use the same markup for creating a consistent UI between the metro app and a website and although this is somewhat true it appears as though at lest for now the metro controls will not render IE.

    I would really appreciate some more info on the subject.

    Wednesday, August 01, 2012 7:58 AM

All replies

  • Hi,

    it's more a question of your background. If you're a web developer with no knowledge about C#, C++, or XAML you have a starting point with technologies you're already familiar with (HTML and JS). For me it's like C# and VB - You can do the same in both languages.


    Best Regards. When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer. This helps us build a healthy and positive community.

    Wednesday, August 01, 2012 9:18 AM
  • Hi

    I agree with 

    For example:

    If you are a web developer you will choose HTML/JS, because you familiar with HTML5 Jquery.

    Till now you don't have any chart control in metro xaml. But you can get a lot for chart tool in jquery.

    please refer to

     http://social.msdn.microsoft.com/Forums/zh-CN/winappsuidesign/thread/eed51fae-8a2c-46ab-bf1c-1d7e865abe33

    Wednesday, August 01, 2012 1:47 PM
  • I'm an expert C# developer, but I'm also good at JS, HTML and CSS.

    For certain kinds of apps I find HTML/JS to be an extremely rapid way of getting an app up and running. And WinRT/Winmd make interop possible with more traditional back-ends.

    Building a 3D game? C++

    Building a line of business app with a complex datamodel? C#

    Building a quick app or a rich multimedia experience? JS


    Wednesday, August 01, 2012 5:09 PM
  • Aside from the fact that JavaScript is a joy to use while C++ and C# make a person want to hurt themselves..? ;)

    HTML is a mature templating language with years of development, with input from dozens of different companies and a lot of the top developers in the world... when it comes to layout you simply cannot be HTML.
    Wednesday, August 01, 2012 5:29 PM
  • Thanks for some of the advice guys, but i was hoping for more information. A lot of the answers posted so far have been very general.

    Other than KMoon, non of the answers provide any evidence for their statements and are relying on very general well known information.

    If i was a developer, who is well versed in a variety of object orientated languages, and understand the role of a markup language. Why would i choose one language over the other for a certain scenario.

    For example, you can not call certain libraries with JavaScript, DirextX is a good example. So if i was trying to make a hardware accelerated DirextX game, JS/HTML would be a bad choice.

    What other limits do these languages have? Thanks to KMoon I found out some great features about the JavaScript language i didn't know, such as being able to pass around functions like objects, their is another clear advantage.

    Saturday, August 04, 2012 5:12 PM
  • In a perfect world platform choice would be a function of your technology background and app specifics. But in the real world IMHO JS/HTML5 currently has an edge over XAML platforms, because:

    1) XAML platforms (especially C++) seem to be more buggy to me personally. I worked closely with several people writing Metro apps for Window 8 on all platforms and found that C++ people were usually pulling their own hair quite often because of platform bugs, C# folks (especially ones who expected full power of WPF) hit several serious road blocks but were able to work around to one degree or another. JS people had the easiest time (though there still were some problems - I had to cut a few minor UI features from the app because of rendering artifacts). The gap was quite severe in Developer Preview. It somewhat narrowed in Release Preview but it is still there.

    2) HTML5/CSS/JS offers greater flexibility in terms of UI design, especially when it comes to creating UI that adapts to portrait and snapped views. Often I would just change display style from grid to flexbox, hide a few divs and I'll have my snapped view nice and ready. For XAML it would have taken full re-creation of the document tree. HTML/CSS also offers more features like text-shadows that are missing from Metro XAML (you can emulate it by jumping though some hoops but why bother)

    3) While JS is not a quick as C++ and C# for many tasks it is quick enough (it runs Cut the Rope) and Metro makes it super easy to call C++ or C# functions from JS so you can offload your intensive calculations to DLLs written in these languages (and perhaps even have them run on GPU)

    For the record: I'm not biased. I learned C++ years ago and still love using it when I can. I've done most of my coding in C# in the recent years and only with Windows 8 started to use JS in a serious way. Unfortunately with Metro C++ just doesn't fly yet.

    Sunday, August 05, 2012 6:45 PM