language choice : C++ or Javascript for developing rich Windows store app ? RRS feed

  • Question

  • Hi, 

    I need some input in choosing the language (C++/XAML or HTML/JS) for a windows-store-app given the following criteria.

    1. the app is a generic photo editing app, so there will be quite bit of UI panels. 

    2. Allow image manipulations - like cropping  and adding effects ( like instagram ) and basic painting and adding text to the image layer etc.

    3. has an organizer - which shows images in a grid and allow things like sorting etc. 

    4. i already have some existing C++ libraries and i wish to leverage them (its a blocker to me if i am unable to use these libraries)

    5. i am expecting the app to be "not-basic" but a professional average app when it comes to amount of source code that would go into development. - so i am concerned about the future maintenance ( of code ) part as well. 

    6. Performance is an important factor. 

    i am basically a C++ developer, i dont have much knowledge about XAML. i have fair/good understanding of javascript/HTML/CSS.

    I have following thoughts in my mind - 

    HTML/Javascript  : 


    1. Easy to use. Can quickly bring up things easily and get the basic things working. 

    2. has a rich HTML/JS community, so easy to get questions answered. 


    1. Performance  (  ? ) - i am worried about the final app performance, the initial basic version might not have any performance bottleneck but i am worried that given the functions are loaded and keeping everthing in dom - things would be slower when i have the overal app and when user use the app for long time.

    2. Modularity and maintenance : difficult to structure javascript code in a flexible extensible manner - (this is my understanding - might not be true  maintaining the code would be tougher ? 

    For C++ :

    Cons : 

    1. Need to write more code : I need to write way more code than javascript. manipulating DOM  by changing HTML/CSS properties is such an easy task. eg: by just changing the classname of an element we can have it work differently in different situation easily.  Do we have the same thing available on C++/XAML as well ?

    Questions :

    i have some grey areas and i need some information to get more clarity

    how rich is XAML compared to HTML version ? - i guess the number of controls offered is the same ( or there is difference? ) .. also, how easy to order elements within containers ? like say i have screen and place different UI panels at different places - typically, for HTML , i end up using display:-ms-grid on a div element to order elements withing a container , thins like placing an inner element at center or end or start. how easy to do these with XAML ? 

    are there any caveats in XAML that i need to be aware of ? how easy is it to define UI in XAML - in the sense does it provide finer control over positioning of elements in a relative way (so that the UI fits correctly when taken to different screen etc)

    In terms of flexibility , meaning ability for the developers to easily tweak and tailor something (lets say , AppBar element or adding new custom UI element) to his needs, does both language provide same support ? 

    Are there any things are available in one language and not other (wrt to my app ) that i need to be aware of  ? 

    Is threading available on Javascript ? which language has better support ? 

    i haven't played with lambads yet on C++ and since WinRT APIs are mostly async, how easy/difficult is it on C++ compared with JS. in general which language is good when it comes to dealing with WinRT APIs. 

    how is the community support for C++/XAML based questions ? i worked a bit on this (a small C++/XAML ) earlier and didnt find the support encouraging. 

    I guess these are the questions that typically haunt the entry level developers to windows-store-apps world and this would really benefit other developers as well, so would really appreciate some concrete answers to the above.



    • Edited by naiveCoder Friday, March 15, 2013 11:26 AM
    Friday, March 15, 2013 11:19 AM


All replies

  • Hi Raj,

    You can select C++ /XAML .

    In your case you want to perform image manipulation and you could do it by using Direct2D,Direct3D.

    Please see DIRECT2D built in effcts here - Effects

    As you know these libraries are written in C++ and you can use it diaractly in your app if you go for c++.

    Otherwise  you have to write a WinRT component.



    • Edited by BhashTech Friday, March 15, 2013 1:50 PM
    • Marked as answer by Jesse Jiang Friday, March 22, 2013 1:28 AM
    Friday, March 15, 2013 1:49 PM
  • For the second question, there is canvas control in XAML, you can easily control the layout in it. Also there are other control like stackPanel or grid, please take a look of this

    Also, there is  most function control in XAML

    Generally speaking, we can separate the UI and data, we can write UI with JavaScript and do the control codes with C# or C++/CX. In JavaScript we can call the Windows Runtime Components to do this.

    Best regards,

    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Jesse Jiang Friday, March 22, 2013 1:28 AM
    Monday, March 18, 2013 3:02 AM
  • You can always do the heavy work in C++ WinRT components and use HTML/JS for the layout and business logic. I would always favour a HTML5/CSS separation over this XAML mess and hope that MSFT will eventually drop XAML like Silverlight and give C++ developers easier access to the IE HTML render engine. In fact you can already do that today, have your app be the backend and let IE render its controls. That's what wwahost.exe does. It injects the WinRT COM components into the JS Engine of IE.

    Performance is really not an issue with JS apps. It will be often fast enough if you do it right. Doing it wrong will also slow down C++ apps. The IE renderer facilitates the GPU for some fancy stuff like transitions. If you take care of that, JS apps will most likely be even faster than XAML based apps. It will be also less binary code.

    Wednesday, March 20, 2013 10:37 AM
  • I assume Zuckerberg was referring to X-Browser compatibility, which is not an issue for Win8 JS apps since they only run on the IE engine. Beside that, someone checked the Fakebook HTML5/JS app and found that it was badly programmed from the start in the first place and had nothing to do with HTML5 or JS in general.
    Wednesday, March 20, 2013 3:17 PM