Microsoft likes WinJS for making Windows 8 apps but most developers prefer XAML

The Facebook Windows 8 app was developed by using the XAML language

Even as the number of Windows 8 Modern apps in the Windows Store continues to grow, there appears to be a difference between what third party developers use in making those apps compared to Microsoft's own in-house creations.

ZDNet conducted a survey of the top 25 apps in the UK version of the Windows Store and found that 80 percent of them use the XAML language. That includes apps such as Facebook, Netflix, Google Search and more. Three of the top 25 apps use WinJS, including Microsoft's own Solitare Collection, along with Viber and Cut The Rope. One app on the list, Jetpack Joyride, was coded in C++. The survey was base on using a software tool created by the author of the article that scanned the apps to see which coding language was used.

By contrast, the vast majority of Microsoft's in-house Windows 8 apps use WinJS as its programming language, including nearly all of the Bing apps except for Bing Maps, which is coded in XAML. Microsoft's Camera and Reader app are also made by using XAML but others like Skype, the Windows Store itself and Xbox Live use WinJS.

So why does Microsoft prefer WinJS while other developers seem to lean towards XAML for making Windows 8 apps. The article speculates that Microsoft wanted to make apps for the OS more accessible to developers by using WinJS, which supports HTML and JavaScript. The author also believes that Microsoft wanted to showcase WinJS by building most of its own apps with that language. However, based on the survey, it would appear that developers outside of Microsoft want to make apps by using the company's proprietary XAML language.

Source: ZDNet | Image via Facebook

Report a problem with article
Previous Story

New Windows 8.1 update 1 screenshots highlight modern app pinning

Next Story

Nokia to hold press event at Mobile World Congress Feb. 24th

45 Comments

Commenting is disabled on this article.

It is, but it's the simplistic way to refer to the way of writing a Windows Store app. "Xaml" covers the .Net languages and C++/CX, so it's conveniently XAML vs HTML/JS.

It's less about the markup language itself, and more about the WinRT.UI.Xaml UI framework (including the layout and rendering engines, controls, etc).

I do find it a bit annoying when people conflate it with .NET though, since you can use XAML with native C++ (with or without CX extensions).

I would imagine this is because most *non-web developers* give JavaScript a shot and just don't like it. It's well-suited for the way it's used in web development, but it's a major step backward when compared to production languages. It would be akin to taking away your PC and replacing it with a smartphone. Sure, you can do a whole lot with the smartphone, but it's a little awkward and limited compared to sitting down to work on a full workstation.

C# is a great language and their XAML based APIs are nice and clean for UI development. To me WPF and Silverlight took a long time to take off. By the time developers started using them Microsoft had already given up and shifted to JavaScript. I think they made that decision in order to attract more developers. It seems most developers are C++ or JavaScript which I am guessing is the same for Microsoft's developers. Maybe that is why their apps are built with JavaScript. JavaScript makes sense if you want to build an app that can be reused on other platforms although you cannot use WinJS on other platforms.

Most non-browser-based developers prefer C++ or C# simply because HTML and WinJS (or even any form of Java in general) even SOUNDS like a browser port; further, if you have any experience in non-browser-based programming, you likely started with C++ (and C# is little different). Silverlight's real competition has been Flash (which also has the advantage of being supported very well outside of Windows)) - doesn't the same apply to XAML?

BillyJack said,
C# is a great language and their XAML based APIs are nice and clean for UI development. To me WPF and Silverlight took a long time to take off. By the time developers started using them Microsoft had already given up and shifted to JavaScript. I think they made that decision in order to attract more developers. It seems most developers are C++ or JavaScript which I am guessing is the same for Microsoft's developers. Maybe that is why their apps are built with JavaScript. JavaScript makes sense if you want to build an app that can be reused on other platforms although you cannot use WinJS on other platforms.

You can use most of WinJS on other platforms... It's been done.

And JS apps on Windows don't have to use WinJS (it's just a JS/CSS library, like jQuery).

Brandon Live said,
You can use most of WinJS on other platforms... It's been done.

And JS apps on Windows don't have to use WinJS (it's just a JS/CSS library, like jQuery).

I haven't used it yet. I thought you needed WinJS to interact with the Runtime etc.

MrHumpty said,
I haven't used it yet. I thought you needed WinJS to interact with the Runtime etc.

You don't need to use it. Though it's highly recommended you use at least the tiniest bit for handling app startup. And working with async WinRT APIs is much easier using WinJS.Promise. But it's not required. The rest is just handy utilities (many are just equivalents to things you'd find in jQuery and such), templating + data binding, and some handy UI controls like ListView, NavBar, AppBar, etc. Obviously those are up to you to use or not at your leisure.

Brandon Live said,
You don't need to use it. Though it's highly recommended you use at least the tiniest bit for handling app startup. And working with async WinRT APIs is much easier using WinJS.Promise. But it's not required. The rest is just handy utilities (many are just equivalents to things you'd find in jQuery and such), templating + data binding, and some handy UI controls like ListView, NavBar, AppBar, etc. Obviously those are up to you to use or not at your leisure.
Ah cool. I honestly figured it would be a requirement to use WinJS. Have they officially finished the version of JQuery that will be allowed in Store apps?

MrHumpty said,
Ah cool. I honestly figured it would be a requirement to use WinJS. Have they officially finished the version of JQuery that will be allowed in Store apps?

Well you can include whatever you want, but it looks like jQuery 2.0 was released with official support for Win8 apps a while back.

Have you ever really used it? Modern JS can be quite a joy and very productive. Of course it depends some on what you're trying to do. It's getting better all the time, too, and ECMA 6 looks very promising for addressing some of JavaScript's foibles.

Node JS just means that you can do cool stuff with javascript. But you can do cool stuff with any language if it's shoved down enough developers throats relentlessly for 20 years.

Yeah, screw the asynchronous nature of the language. Screw promises, screw using the same syntax in front and backend (socket.io). Screw it all...

SOOPRcow said,
I'm betting it's because nobody ****ing likes JavaScript. God do I hate JavaScript. I swear I would rather work in C.
This statement is hilarious to most dev's out there.

I have never worked with someone who actually likes writing in JavaScript. Believe me, I understand and appreciate it's value. My problem with it is that people are trying to use it as an application level language when it was only ever meant to be a scripting language. It just feels so forced at this point. It is not a syntactically pretty language by any means. It's weak-typing and lack of any real objects doesn't help with the readability and makes optimization incredibly complex. It just feels like a scripting language that is being pushed to far.

Don't worry, I am pretty much the only one (okay, one of two) in our company who really likes it. Anyway, you know that JavaScript has been introduced as a server side application language? Of course weak-typing has disadvantages, but also advantages. I'm much more flexible and don't have to build constructs of base classes and delegates to solve certain things. I think as long as you stick to the "separate of concerns" Principe and do code commenting it is far easy to understand what is going on.

SOOPRcow said,
I have never worked with someone who actually likes writing in JavaScript. Believe me, I understand and appreciate it's value. My problem with it is that people are trying to use it as an application level language when it was only ever meant to be a scripting language. It just feels so forced at this point. It is not a syntactically pretty language by any means. It's weak-typing and lack of any real objects doesn't help with the readability and makes optimization incredibly complex. It just feels like a scripting language that is being pushed to far.

This is all just false. JavaScript is a misnomer, yes, but it's not "just a scripting language" and it has evolved hugely since its early days. The current version used in these apps, ECMAScript 5, is a very rich, modern, capable language.

It absolutely has "real objects" and is no less easy to optimize your code in than C#. In fact, with tools like jsperf.com it's probably easier (see http://jsperf.com/array-extending-push-vs-concat/7 for an example).

It has its foibles. You will encounter bugs a C++/C# compiler would have caught. Refactoring can sometimes be a pain, especially if you don't build for it early on. ECMAScript 6 with its opt-in strict typing will help with both of those though.

But it also has many, many advantages. And I completely disagree with the readability part. If you write good code there is *no* reason JavaScript code is going to be any less readable than, say, C#. In fact, in many cases I find it easier. For example, I much prefer the promise.then() model over the await model. Makes it far clearer what is going on, and without the crazy black magic await does in loops and such.

He probably meant that you don't know for sure how your objects look. Theoretically they could be anything. But for me this is a major advantage of the not type-safe languages.

Well, there are *some* types (those identified as other than "object" by the typeof operator). And beyond duck typing you also have instanceof. But being a loosely typed language doesn't mean its objects are anything less than objects.

XAML + C#/VB is a more mature development model. WinJS is relatively new, so if the majority of devs are already capable XAML developers, they will go with what they know.

WinJS is basically just JavaScript and HTML with some extensions. Way more developers know JavaScript/HTML. You only have to know basic web programming to make a Windows Store app, it's stupidly easy.

I think the top apps don't often use WinJS because they're usually more advanced, and XAML + C# is more capable and suited for them.

NoClipMode said,
WinJS is basically just JavaScript and HTML with some extensions. Way more developers know JavaScript/HTML. You only have to know basic web programming to make a Windows Store app, it's stupidly easy.

I think the top apps don't often use WinJS because they're usually more advanced, and XAML + C# is more capable and suited for them.

There are other reasons. Many of Microsoft's evangelists are big .NET fans, so they push XAML to partners. And a lot of people just don't understand WinJS. Others heard what Zuckerberg said about HTML5 being a mistake, and decide against it for that reason. The thing is, Zuck was wrong. JS/HTML wasn't the reason their apps sucked. Apple's hate for it and intentional crippling of it on iOS certainly was a factor, though.

XAML on its own does not build an app... C# and VB are the real languages, not XAML. XAML is just a design language.

I entered a contest (and got third place!) with a simple WinJS app, but found the performance not nearly as good as when I ran the same code in a web browser. So I found it surprising that Solitare Collection is WinJS, and smooth at that. Clearly I'm not doing something right

Mathachew said,
I entered a contest (and got third place!) with a simple WinJS app, but found the performance not nearly as good as when I ran the same code in a web browser. So I found it surprising that Solitare Collection is WinJS, and smooth at that. Clearly I'm not doing something right

The JS app platform on Windows is very fast, often faster than using XAML for many things. Of course, the biggest difference comes not from the platform but how you use it.

Shadowzz said,
Yeah, even Solitaire... such a giant battery drain, simple card game turning my 920 into a space heater.

Not the best apps to show off WinJS....

Are you sure it's not cross checking data from the weather app and just helping to keep you warm? hehe

No idea about the store but Skype, Live,Bing and Xbox apps may have been developed in WinJS because they are web properties and most of the code could be shared. (Skype online is coming soon I think?)

Shadowzz said,
Yeah, even Solitaire... such a giant battery drain, simple card game turning my 920 into a space heater.

Not the best apps to show off WinJS....

Solitaire is not a WinJS app. It's a D3D app.

If it were a JS app it would run in wwahost.exe.

gawicks said,
No idea about the store but Skype, Live,Bing and Xbox apps may have been developed in WinJS because they are web properties and most of the code could be shared. (Skype online is coming soon I think?)

The Store is a WinJS app plus C++ code. Mail is much the same.

Every non-game on Xbox One today is WinJS, including the dashboard. It's a really great platform.

Brandon Live said,

Solitaire is not a WinJS app. It's a D3D app.

If it were a JS app it would run in wwahost.exe.


That includes apps such as Facebook, Netflix, Google Search and more. Three of the top 25 apps use WinJS, including Microsoft's own Solitare Collection

Also I was confusing Windows 8 with WP8

BajiRav said,
Skype and Store are developed using WinJS? That explains a lot of their problems.

The store is really slow and so is Cut The Rope compared to other apps in responsiveness.

ians18 said,

The store is really slow and so is Cut The Rope compared to other apps in responsiveness.

The Store has gotten better, but the problems it has had have nothing to do with using HTML/JS for its UI. In fact, most of the store is C++.

I'm not sure how Cut The Rope is implemented. That is, it might be all drawing to a canvas which isn't really "HTML." I never had a problem with it even on a first-gen RT, except for one screen where they messed up the scrolling/panning (which is actually a challenge to do in a JS app). Somehow they implemented it dependently (so it happens on the UI thread) and slowly at that. But it was just that one level select screen and most people just used the big arrows on either side anyway.