Coffeehouse Thread

39 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

C#/XAML vs. WinJS/HTML

Back to Forum: Coffeehouse
  • User profile image
    DeathBy​VisualStudio

    ZDNet posted an interesting article on the "preferred" language/design language for building W8 apps. Surprisingly(?) most third party apps were developed using C#/XAML while most of Microsoft's used WinJS/HTML.

    I don't write Windows Store apps but I'm curious for those that do is there any advantage to using WinJS/HTML other than:

    1. Possible re-use of assets (beyond images?)
    2. Access to the bazillion libraries for JS (though do they all play nice with W8 or are you limited in some way?) 
    3. Access to more, less expensive software engineers.
    4. Something else?

    What do you prefer to write Windows Store apps in and why?

     

    If we all believed in unicorns and fairies the world would be a better place.
    Last modified
  • User profile image
    Proton2

    I have separated my code out so that most of it will be reusable for both phone and store. I haven't written the store app yet, but I have made a store project that simply contains links to files of my phone code, and it compiles. The UI parts, the views are the only components, except for a few minor bits, that are different between my phone app and the store version.

    So its a no brainer that my store app version will be using c#, and later C++ perhaps,

  • User profile image
    RealBboy360

    Wow, most of ms apps developed in HTML?  C#/XAML is much better than javascript (binding and converters).  

    The whole re-use thing is crap.  You're not going to use the same UI for phone, app as you are a website.  Even if you did, how much UI are you going to have on a phone or metro app.  The bulk of the work is on the web service anyway.

    I guess you could re-use the code on android or IOS, but then you can use phonegap or Xamerian or a bazillion other things.  Got a headache now.  Just watch MS kill XAML in a couple years though.

  • User profile image
    magicalclick

    That's odd. But, that explained why Zune Music and Video has terrible performance. MS probably used it to test the system, because during beta, they were super bad. Like Solitare was like 2fps , incredibly bad. Personally I don't trust whatever they said it is ok, because I have Gadget horror stories. Even now, I have Gadget horror stories. The platform is still unstable in reality.

    Leaving WM on 5/2018 if no apps, no dedicated billboards where I drive, no Store name.
    Last modified
  • User profile image
    MasterPi

    , RealBboy360 wrote

    C#/XAML is much better than javascript (binding and converters).  

    You can do data-binding in javascript.

  • User profile image
    felix9

    for the MS side, I believe the Store and Reader were the original dogfooding apps for testing their platform in real development, but most of the internal UI work in WinDiv are using more and more Xaml and less DUI70, like ImmersiveControlPanel, Search, FileManager, and many internal shared components, all C++/Xaml.

    and, most of the other MS WinJS apps actually come from the Bing appex team, in the online services department, where most of devs using JavaScript primarily, have lots of expertise and code can be shared, so WinJS is the natual choice for them, but TypeScript is also used lately.

    for the 3rdparty side, I guess at this stage, people who willing to develop Win8 apps are mostly come from the traditional loyal MS dev camp, where C#/Xaml/WPF/Silverlight are very popular and familiar, so C#/Xaml is the natual choice. and for real games, C++/DX is the only viable choice.

    I think originally MS want to use JS to lure those developers in JS camp and not so loyal or familiar or intersting in traditional MS tech like .NET to develop for their platform, but as the platform itself didn't get much market share, this effort will be hard to success.

  • User profile image
    Bass

    WinJS seems to be this massive monolithic proprietary library specific to Win8. It even has UI controls, which bizarrely don't work outside the context of a Win8 store app. Any legitimate reason why?

    It's kind of like taking all the disadvantages of using JavaScript and none of the advantages (crossplatform, open ecosystem, etc.) so no I'm not surprised it's not being used. It would make more sense that most the WinJS stuff would be a JS library that could also run under browser contexts (like most libraries, eg. jQuery).

  • User profile image
    DeathBy​VisualStudio

    , Proton2 wrote

    I have separated my code out so that most of it will be reusable for both phone and store. I haven't written the store app yet, but I have made a store project that simply contains links to files of my phone code, and it compiles. The UI parts, the views are the only components, except for a few minor bits, that are different between my phone app and the store version.

    So its a no brainer that my store app version will be using c#, and later C++ perhaps,

    I really hope in Threshold there is less of a requirement for this kind of separation. It would be great if W9, WP, and XBox could have a base set of controls and APIs that they share. Even better if these controls could morph based on screen size and capability kind of like the ribbon that would be great for simple apps (and aren't many "apps" UI simple?). Individual controls could morph to input methods available (or in use) at the time (touch, voice, mouse, keyboard). With these simpler UIs the Microsoft design language seems to depict I don't see why a clever developer couldn't make that work.

    And of course for those who want to use the maximum each device type was capable of they could split the app up more as you're doing today.

    , RealBboy360 wrote

    Wow, most of ms apps developed in HTML?  C#/XAML is much better than javascript (binding and converters).  

    The whole re-use thing is crap.  You're not going to use the same UI for phone, app as you are a website.  

    If it's Metro, side scrolling and all, the possibilities are endless... :)

    If we all believed in unicorns and fairies the world would be a better place.
    Last modified
  • User profile image
    DeathBy​VisualStudio

    , Bass wrote

    WinJS seems to be this massive monolithic proprietary library specific to Win8. It even has UI controls, which bizarrely don't work outside the context of a Win8 store app. Any legitimate reason why?

    It's kind of like taking all the disadvantages of using JavaScript and none of the advantages (crossplatform, open ecosystem, etc.) so no I'm not surprised it's not being used. It would make more sense that most the WinJS stuff would be a JS library that could also run under browser contexts (like most libraries, eg. jQuery).

    For Microsoft I think it's more about "skills transfer" (like WPF to WinRT XAML) than it is about implementing a true web compatible UI and API (though I've never done any W8 programming so anyone with some actual experience feel free to jump in here and explain how its more than that). Unfortunately those plans appear to be for not as Felix9 infers and the report seems to indicate.

    If we all believed in unicorns and fairies the world would be a better place.
    Last modified
  • User profile image
    RealBboy360

    asp.net 4.5 has databinding too, but no converters and the type of virtualization c# xaml has.  Going from xaml programming back to web programming feels like getting punched in the face.  I'm sure if you polled people who have done work in both xaml and html/javascript you'll get around 90% preferring xaml

  • User profile image
    kettch

    @RealBboy360: For me the difference is that XAML understands data binding while Web technologies can have data binding forced down their throats using a lot of time and lube.js.

  • User profile image
    contextfree`

    felix is correct on all counts.

    Brandon Paddock, author of my favorite Twitter client and a former Windows shell developer, just made a nice post with his take on the various UI and programming models available on Win8 and other platforms.

  • User profile image
    RealBboy360

    , contextfree` wrote

    felix is correct on all counts.

    Brandon Paddock, author of my favorite Twitter client and a former Windows shell developer, just made a nice post with his take on the various UI and programming models available on Win8 and other platforms.

    This guy's posts are pretty good.  He has a great mvvm take too:

    http://brandonlive.com/2014/01/23/my-mvvm-rant/

     

    I don't see moving my app to Windows 8 until that one language comes out though.  For a lot of things, I don't see the use of tablet app or desktop app vs a website.

  • User profile image
    Bass

    , DeathBy​VisualStudio wrote

    *snip*

    For Microsoft I think it's more about "skills transfer" (like WPF to WinRT XAML) than it is about implementing a true web compatible UI and API (though I've never done any W8 programming so anyone with some actual experience feel free to jump in here and explain how its more than that). Unfortunately those plans appear to be for not as Felix9 infers and the report seems to indicate.

    They totally missed the point of JavaScript. It's not about the language itself, it's about its prevalence. Your code will literally run everywhere. I don't think JS is as horrible as some people here do, but it's not a easy language to develop complex software in and it's not particularly well designed. And it's not like C# and JavaScript are super different. If you are a JavaScript pro or a C# pro you can pick up either easily. They have much of the same keywords and syntax for f**ks sake. You'll have to learn an entirely new fat library in any case - that's where most of the learning curve is.

    So why the * would you use JavaScript to code against a proprietary API that runs on one OS? Oh right, you wouldn't. Which is why no one is using it. :) Derp?

    Now if they made much of this WinJS stuff a open source library that runs properly within the context of a semi-modern browser, I would bet you that a lot more people would be using it. Because they'd be like, well I can make a Windows 8 app but also have my stuff up on my website for people not using Windows 8. And I don't have to rewrite everything. That's pretty damn cool, right? Surely more people would use it if that was the case. But that might not meeting Microsoft's business objectives with it. But hey, their business objectives were never going to be met anyway.

  • User profile image
    Proton2

    So why the * would you use JavaScript to code against a proprietary API that runs on one OS? Oh right, you wouldn't. Which is why no one is using it. :) Derp?

    I expect the potential users of my app to have a windows machine. And why do I expect that? Because we no longer live in a digital divide world, where society is divided between the rich who can afford a computer and the rest of us. Do you remember the digital divide? You can get a windows machine for $100. See Nokia 520.

     

  • User profile image
    Proton2

    , RealBboy360 wrote

    *snip*

    This guy's posts are pretty good.  He has a great mvvm take too:

    http://brandonlive.com/2014/01/23/my-mvvm-rant/

     

    I don't see moving my app to Windows 8 until that one language comes out though.  For a lot of things, I don't see the use of tablet app or desktop app vs a website.

    I read his MVVM post last night. He missed the entire reason I use MVVM. I learned MVVM by following a tutorial blog post using test driven development principals and the creation of the view model code:

    http://codingsolutions.blogspot.ca/2010/03/windows-phone-7-tdd-kata-using-mvvm-and.html

    I was able to create most of my windows phone code while using nothing but the desktop. My phone project has mostly just view files, the page and its code behind, the rest of the code lives in a class project (using the technique of linking files).

    There are other benefits for me with MVVM, and its the TTD part. I couldn't get my projects done without having my test code. Its how I see where I am in my development of my project. Its my documentation of my code. Its my safety harness for my refactoring. Its my aglow with whirling, transient nodes of thought careening through a cosmic vapor of invention. I think its my bed time.

  • User profile image
    Bass

    , Proton2 wrote

    *snip*

    I expect the potential users of my app to have a windows machine. And why do I expect that? Because we no longer live in a digital divide world, where society is divided between the rich who can afford a computer and the rest of us. Do you remember the digital divide? You can get a windows machine for $100. See Nokia 520.

    Right. But Microsoft not a relevant market player in these spaces. This "Windows Phone" despite having Windows in the name shares almost nothing with the Windows of the past. It doesn't look like Windows, it doesn't have an open software ecosystem like Windows, and most importantly it doesn't have the marketshare of Windows. It is niche product with a very small marketshare. The spiritual continuation of Windows is made by a company called Google and it's called Android.

    Really if you are going to write to a proprietary API using Android's API makes the most actual sense. But if you want to target all devices JavaScript makes the most sense, but not using WinJS. WinJS seems to make no sense for anything.

  • User profile image
    BitFlipper

    , Bass wrote

    *snip*

    They totally missed the point of JavaScript. It's not about the language itself, it's about its prevalence. Your code will literally run everywhere.

    But Microsoft doesn't want the code to run everywhere, they want it to run on Windows. That is why they killed Silverlight. Someone in Microsoft realized SL can become its own platform which can run rich business applications in any browser and doesn't require Windows underneath. Oops. Kill It!!

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.