locked
what is the preferred language for developing metro apps???

    General discussion

  • hello,

    want to ask a basic question. there are many options for developing metro apps for windows 8 (c++, c#, vb and javascript). just wanted to know which is the preferred language.... can anyone please let me know what are pros and cons of the same?

    any help would be appreciated.

    regards,

    saurabh

    Monday, June 25, 2012 10:50 AM

All replies

  • I guess there is no preferred language. You should choose what you feel the most comfortable with. I was quick in prototyping Metro apps in Blend+JS but your experience may be different. 

    Currently there are apps developed in C++/C# and HTML/JS in the store. MS mostly uses a mixture of C#/C++ WinRT component and JS. Others (Evernote) use the native approach, possibly because they already had a large codebase from the Win32 desktop they could simply port over.

    So you have to choose yourself. HTML/CSS is the quickest to prototype in and the Blend support is working well. I have not checked out the current state of C# and Blend support but until CP it was pretty much useless and unstable. So if you already have a WP7 app developed (of course) in C# it would be a good starting point to move it over to Win8. And it will most likely be running on the new WP8 then without much changes again.

    If you start from scratch you could try the HTML/CSS route and see quick develop/compile/run cycles. Of course there is no Unit-Testing for JS in VS yet but 3rd party libs will soon be available that fill that gap.

    I would not go the C++ only route as the code looks rather ugly and UI performance wise the additional speed gained by the native languages is not so important. For CPU intense tasks you could always build WinRT C++ components that would be usable in all WinRT supported languages.

    Monday, June 25, 2012 12:44 PM
  • Thanks a lot Phil. So you are saying that an app written in C++ and XAML would run very slow compared to HTML and JS? Am I getting it correctly? I was actually contemplating using C++ and XAML because i thought the combination would be better in performance.

    Performance is the key to me. So keeping that in mind, what should I go for?

    Really appreciate your help on this.

    Regards,

    Saurabh

    Monday, June 25, 2012 2:24 PM
  • No, I meant the development cycle is naturally faster with non-compiled projects compared to compiled ones (JS vs C++/C#). Other then that nothing against using C++ XAML. Although I really cannot parse the ugly XAML with my eyes and prefer clean HTML/CSS any time. Let alone for animations. Its cruel to do them in XAML.
    Monday, June 25, 2012 2:32 PM
  • Thanks a lot Phil. Last two questions. 

    1. Is there any recommendation from Microsoft as to which option/language would be better?

    2. Is there any data as to which language is better at performance?

    Thanks for all the help.

    Regards,

    Saurabh

    Monday, June 25, 2012 3:00 PM
  • Saurabh I can not speak for MSFT, we have to wait for their response here. But generally speaking: How fast is fast enough for the app? If you need high performance C++ is the way to go. But for 90% of the apps I think every other option is easier to implement, HTML/CSS being the easiest (for me at least).
    Monday, June 25, 2012 3:36 PM
  • I would not go the C++ only route as the code looks rather ugly and UI performance wise the additional speed gained by the native languages is not so important. For CPU intense tasks you could always build WinRT C++ components that would be usable in all WinRT supported languages.


    Well syntactic beauty is quite subjective. There are many who find C# ugly. Purist C++ devs would find C# and C++/CX equally alien-looking but would probably pick C++/CX over C# since it has an arguably reduced learning curve. Devs with C++/CLI experience would certanly go for C++/CX for its similar syntax.

    http://blog.voidnish.com


    Tuesday, June 26, 2012 2:21 AM
  • In theory, C++ would be your fastest option. WinRT is a native API and C++ is currently the only native compiler that can be used against WinRT. C# and VB would both bring in the .NET/CLR layer while JS would bring in Chakra.

    If you have HTML/JS code, you would most certainly want to pick C++ as the component language since mixing JS/HTML with C#/.NET would bring in two "managed" frameworks - Chakra and .NET, something you probably want to avoid.

    That said, if you want access to the extensive .NET libraries (although it's a reduced set for Metro), C# will not be a bad option there. And the C# and CLR teams have done a lot of work in optimizing their interop with WinRT. So for most UI scenarios, the performance advantages may or may not be of value depending on your specific scenario.


    http://blog.voidnish.com

    Tuesday, June 26, 2012 2:27 AM