What’s the Question?

From the .NET Framework 1.0 to 4.0, an overarching question for developers echoes throughout the halls of new app development… C# or VB.NET? Now in .NET Framework 4.5, developers have a new rivalry to ponder: XAML/C# or HTML5/JavaScript? Making this new choice has farther reaching implications than the prior C#-or-VB.NET decision. But what’s it all about, anyway?

Before Windows 8

Picking between C# and VB.NET is largely a personal decision. Both languages are mature, straightforward, and you can effectively do the same things identically in both languages. If you were to convert C# to VB.NET or vice versa, you can effectively do a line-by-line translation. Some developers work only in one language, but most can switch back and forth. Right now, I am working on multiple C# and VB.NET applications simultaneously. Other than occasionally starting to write in the wrong syntax, it’s no problem. Personally, I do prefer C#, but it’s neither a big deal nor a deal-breaker to work in VB.NET.

After Windows 8

When developing in Visual Studio 2012 for Windows 8 or Windows RT, however, the new decision is a whole different ballgame. When you develop “Modern UI” (formerly “Metro”) style apps, you must choose between a platform of XAML with C# or HTML with JavaScript. Unlike the C#-or-VB.NET decision, the two new platforms have little in common. The tools, controls, concepts, and design environments are totally different. Yet, they share the .NET and WinRT runtime commonality, but it ends there. Converting mid-stream from one paradigm to the other is akin to starting over completely. So it’s not a decision to be made lightly, for one single app or for your career. Both methods have a learning curve, and there will be a polarization between developers much bigger than the C#-or-VB.NET choice.

Well, Should I Focus on XAML/C# or HTML5/JavaScript?

Here are some important points to help guide your decision.

Personal Experience

If you have no experience with web development, C#/XAML will be easier for you. The same goes for experience in C#, even better Windows Presentation Foundation (WPF) or the Model-View-ViewModel (MVVM) design pattern. Knowing those technologies will be less of a learning curve and feel more natural because the XAML/C# stack uses all those familiar components.If you are big on web development, love jQuery, and are just more comfortable on the client-side of things, HTML5/JavaScript is for you. You can continue to use jQuery and your other favorite HTML tools and libraries in tandem with the .NET Framework tools.Advantage: None. It depends on your experience.

Your Application

For game development, 3D modeling, sophisticated rendering, or other very processor intensive stuff, you’re better off choosing C#/XAML. It’s the only option for DirectX integration, and you won’t have to worry about performance issues and limits.Advantage: None. It depends on the kind of apps you do.

Platform Independence

Neither stack is platform-independent. Microsoft proprietary development, people!Obviously, more of the code you write will be portable to other platforms if you use HTML5/JavaScript, as those are “universal” technologies to web development. Don’t think that means you’re automatically writing a cross-platform app, though. It’s still tied in with .NET Framework or the WinRT runtime. You can reuse portions of code, but not anything as a whole. More importantly, your overall concepts and 3rd party tools and libraries can probably come with you.There’s a surprising twist, though… Within the Microsoft ecosystem, XAML/C# is actually the more platform agnostic choice. Currently, Windows 8 apps are the only ones that use HTML5/JavaScript stack. Windows Phone apps (WP7 and WP8) are not compatible with  HTML5/JavaScript but they do use XAML/C#. And “desktop” style Windows applications can be built using XAML/C# if you use Windows Presentation Foundation (WPF). If you’re learning this, there’s a good chance you’re doing other Microsoft stuff as well, so code reuse in the Microsoft ecosystem is actually more advantageous than universal reuse.Advantage: XAML/C#

Future-Proofing

HTML and JavaScript have been around since the early 1990s and are widely known and adopted. They’re not going away. XAML and C# came into use in the mid-2000s, and have since caught on pretty well in the Microsoft community of developers. There is always a small chance Microsoft might kill them off similarly to Silverlight, Windows Phone 7, or the Zune. Don’t get scared, though, it’s very unlikely at this point. But who knows what the future will bring… Microsoft is developing TypeScript, which shows they are putting a lot of stake in JavaScript for the future. I could see that killing off some C# features, like the Razor view engine for starters. It’s clear Microsoft is making strides to utilize and improve upon JavaScript as a core technology.Advantage: HTML5/JavaScript

Ben, What Are You Choosing?

At present, it seems to make sense to choose XAML/C# because it’s more versatile across Windows-based development, which is the majority of what I do.Eventually, though, I think using HTML and JavaScript is the “future” of development… and the industry seems to agree with me. But I don’t think it will be happen any time soon. HTML, JavaScript, and  associated web technologies will overtake proprietary languages like XAML and C#, simply because of the true platform independence. By the the time that happens, though, the paradigm probably will have completely shifted once again. Then, I’ll have to learn something new all over again, regardless.Verdict: XAML/C#. But that won’t stop me from keeping my chops in HTML5, JavaScript and web technologies for the inevitable long term.What do you think?

Like this post? Share it!