Geeks With Blogs
Simon Cooper Peering into the depths of .NET

So, day 1 of DevWeek. Lots and lots of Windows 8 and WinRT, as you would expect. The keynote had some actual content in it, fleshed out some of the details of how your apps linked into the Metro infrastructure, and confirmed that there would indeed be an enterprise version of the app store available for Metro apps.)

However, that's, not what I want to focus this post on. What I do want to focus on is this:

Windows 8 does not make .NET developers obsolete.


.NET in the New Ecosystem

In all the hype around Windows 8 the past few months, a lot of developers have got the impression that .NET has been sidelined in Windows 8; C++ and COM is back in vogue, and HTML5 + JavaScript is the New Way of writing applications. You know .NET? It's yesterday's tech. Enter the 21st Century and write <div>! However, after speaking to people at the conference, and after a couple of talks by Dave Wheeler on the innards of WinRT and how .NET interacts with it, my views on the coming operating system have changed somewhat.

To summarize what I've picked up, in no particular order (none of this is official, just my sense of what's been said by various people):

  • Metro apps do not replace desktop apps. That is, Windows 8 fully supports .NET desktop applications written for every other previous version of Windows, and will continue to do so in the forseeable future. There are some apps that simply do not fit into Metro. They do not fit into the touch-based paradigm, and never will. Traditional desktop support is not going away anytime soon.
  • The reason Silverlight has been hidden in all the Metro hype is that Metro is essentially based on Silverlight design principles. Silverlight developers will have a much easier time writing Metro apps than desktop developers, as they would already be used to all the principles of sandboxing and separation introduced with Silverlight. It's desktop developers who are going to have to adapt how they work.
  • .NET + XAML is equal to HTML5 + JS in importance. Although the underlying WinRT system is built on C++ & COM, most application development will be done either using .NET or HTML5. Both systems have their own wrapper around the underlying WinRT infrastructure, hiding the implementation details.
  • The CLR is unchanged; it's the same .NET 4.5 CLR, running IL in .NET assemblies, as on the traditional desktop. The thing that changes between desktop and Metro is the class libraries, which have more in common with the Silverlight libraries than the desktop libraries. In Metro, although all the types look and behave the same to callers, some of the core BCL types are now wrappers around their WinRT equivalents. These wrappers are then enhanced using standard .NET types and code to produce the Metro .NET class libraries.
  • You can't simply port a desktop app into Metro. The underlying file IO, network, timing and database access is either completely different or simply missing. Similarly, although the UI is programmed using XAML, the behaviour of the Metro XAML is different to WPF or Silverlight XAML. Furthermore, the new design principles and touch-based interface for Metro applications demand a completely new UI. You will be able to re-use sections of your app encapsulating pure program logic, but everything else will need to be written from scratch. Microsoft has taken the opportunity to remove a whole raft of types and methods from the Metro framework that are obsolete (non-generic collections) or break the sandbox (synchronous APIs); if you use these, you will have to rewrite to use the alternatives, if they exist at all, to move your apps to Metro.
  • If you want to write public WinRT components in .NET, there are some quite strict rules you have to adhere to. But the compilers know about these rules; you can write them in C# or VB, and the compilers will tell you when you do something that isn't allowed and deal with the translation to WinRT metadata rather than .NET assemblies.
  • It is possible to write a class library that can be used in Metro and desktop applications. However, you need to be very careful not to use types that are available in one but not the other. One can imagine developers writing their own abstraction around file IO and UIs (MVVM anyone?) that can be implemented differently in Metro and desktop, but look the same within your shared library.

So, if you're a .NET developer, you have a lot less to worry about. .NET is a viable platform on Metro, and traditional desktop apps are not going away. You don't have to learn HTML5 and JavaScript if you don't want to. Hurray!

Cross posted from Simple Talk. Posted on Wednesday, March 28, 2012 10:56 AM | Back to top

Comments on this post: .NET vs Windows 8

# re: .NET vs Windows 8
Requesting Gravatar...
So, in essence, .NET programmers still code and compile the way we have always done, and the app will run smoothly on windows 8???
Left by wale on Mar 29, 2012 9:38 AM

# re: .NET vs Windows 8
Requesting Gravatar...
If you're building a traditional desktop app, yes. If you're building a Metro app, you'll need to use different APIs and async stuff all over the place, but it's still C#/VB running on the .NET CLR.
Left by Simon Cooper on Mar 29, 2012 10:26 AM

# re: .NET vs Windows 8
Requesting Gravatar...
The red orangish color on the back is really annoying. It makes the text in the middle unreadable. I actually sneezed because of it.
Left by Anon on Mar 29, 2012 10:37 AM

# re: .NET vs Windows 8
Requesting Gravatar...
I'm absolutely calm related what you named "hype around Windows 8". The only hype which appear is MS' wish to make "sensation". In reality W8 is an ugliest try to rise interest of customers. W8 is a dog, MS just waste millions on a hindy stupids and rolled out some "toilet inspired" tiles. Mu-ha-ha!! :) Don't you think THIS can shake the market?? Nope. Even me still sitting on WinXP, though under the bonnet sit i7 2600K. And marketoid who decide to drop support for XP is an idiot - he in one action killed half of MS' profit. Applauds! Let's see how some gay will drop MS to dust. :)
Left by Thorn on Mar 29, 2012 1:45 PM

# re: .NET vs Windows 8
Requesting Gravatar...
Descent little article with some good insight.

@Thorn - I dislike personal attacks but you sir, are a dumb-ass.
Left by JoshiJones on Mar 29, 2012 6:05 PM

# re: .NET vs Windows 8
Requesting Gravatar...
"There are some apps that simply do not fit into Metro. They do not fit into the touch-based paradigm, and never will."

Yes. Most tech pundits and bloggers don't understand this for reasons I cannot fully comprehend. For example, trying to imagine Visual Studio ported to Metro causes many of my neurons to try to commit suicide.

"Traditional desktop support is not going away anytime soon."

Anytime soon? It's not going away ever. At least not until some sort of direct neural interface is invented where I can just think about coding in order to code. It will evolve and change (compare today's desktop to the first Macs or Windows 3.1), but it's here to stay.

Microsoft seems to get this for now. As much as the Metro Nazis inside MS are trying to force Metro upon us with the mandatory annoying Start Screen (which looks downright silly on 30" widescreen monitors) and other W8 annoyances, the desktop is still there and it shines. I'm pretty sure there is a contigent within MS that wants to throw all legacy support out sometime in the future, but if they ever do, they will be conceding a very stable foundation of computing to Linux or even Apple.

Then again, COM was supposed to go away when .Net came out (anybody but me remember that?) and now it's front and center again!

Legacy never goes away. And when you force it, you hurt yourself. For example, Windows Mobile (6.x and older) was not exactly growing fast when Windows Phone 7 came out, but it was a pretty sizable chunk at the time (I believe it was just under 20% of the market before they announced WP7). Now it's basically gone and WP7 has not retained many of those users. Why? I firmly believe a lot of it was lack of legacy support. Hopefully that was a lesson learned for MS.
Left by Parrotlover77 on Mar 29, 2012 8:27 PM

# re: .NET vs Windows 8
Requesting Gravatar...
It seems to be convenient that .NET has been sidelined in Windows 8. Great post. Thanks for sharing.
how to make French toast
Left by how to make French toast on Mar 31, 2012 2:56 AM

# re: .NET vs Windows 8
Requesting Gravatar...
I hate the new Win8. But, thank god that it will .Net code. I love Win7 and stay with it forever. CHANGE THE $#%&*& BACKGROUND COLOR!!!!!!!!!
Left by Oscar on Mar 31, 2012 11:11 PM

# re: .NET vs Windows 8
Requesting Gravatar...
IT's a good elaboration of benefits of both. But I still prefer windows. I can't say my opinion with Windows 8 since I did not upgrade my OS (windows 7) to 8. Guess, I hate changes for now.
Left by Tucson Pediatric Dentist on Apr 02, 2012 11:28 AM

# re: .NET vs Windows 8
Requesting Gravatar...
Ok, so my understanding is: DotNet is not as good it should be. The way DotNet works does not fit an operating systems needs. The chance to avoid wrapper here and wrapper there is gone. Wow Microsoft!, sad if you don't trust your own techniques...
Left by Jörg on Apr 13, 2012 12:06 PM

# re: .NET vs Windows 8
Requesting Gravatar...
1. some one hates microsoft
2. that guy maybe seats in the desition making tabla at microsfot
3. why microsoft don't see this forums
4. programming to a browser seams the only way

Bill where are you, come back we need you, i don't want to become a linux guy :(
Left by fernando martinez on Oct 22, 2012 9:44 PM

# re: .NET vs Windows 8
Requesting Gravatar...
Just rebuilding my Kml Builder and all is well in Win7 (the best OS btw) but in Win8 my app refuses to talk with Google Earth Plugin.. Again, a blow to RAD!!!
Left by Win8 Slow Adopter - LongTime Dev on Dec 13, 2012 7:37 PM

# re: .NET vs Windows 8
Requesting Gravatar...
You might as well call the language "C# RT". Many XAML features are just missing, and MVVM development is simply a pain in the ass if you're used to triggers. Expect the average view model to get ridiculously bloated with UI crap in a decent Windows Store app.

When Microsoft Office runs on Windows RT, let me know. Then I'll approve.
Left by JJJ on Jan 08, 2013 12:20 AM

# re: .NET vs Windows 8
Requesting Gravatar...
I've put a .net app on Windows 8 tablet (wishing it was Windows 7). All seems to work except for the keyboard. No control (textbox etc) seems to activate it. You have to do this manually.

Any one found a way around this?
Left by Jiggy on Feb 26, 2013 12:06 PM

# re: .NET vs Windows 8
Requesting Gravatar...
I've been programming since the first Atari computer came on the market (yes, those Commodore64 days of old). Guess that's 35 years now ...

In the old days Microsoft was VB. Plain & simple. Just VB. But then competition came round the corner with java. So Microsoft fought the competition and created .net. The entire Microsoft vb programming community was forced to make the switch to VB.Net, and at the same time Microsoft wanted to steal developers from the competition in order to have them start programming in C# on the windows platform.

It rapidly became clear that Microsoft invested more time in C# over the years, than in VB.NET. In doing so, Microsoft made clear they didn't value their supportive customer base, but only focused on stealing customers from the competition and keeping those happy. And it worked, it worked well. It gave Microsoft the confidence they can pull these things off. As a consequence, Microsoft has constantly implemented this strategy over the past decade ...

Today Microsoft wants to steal people from the non-Microsoft HTML & js world into the Microsoft world, hence MVC. They also want people to move away from the iPads, iPhones, etc. with the Win8 & WinRT. In doing so, Microsoft doesn't value its supportive customer base, and the only attention goes again to stealing from the competition.

If it would value its (supposedly growing) customer base, it would continue their investments in VB.NET, in Windows Forms, in WPF, etc. But they don't. They never value their followers and expect those followers to always make the switch to whatever comes out of their hq, and just swallow it : Don't use VB, its VB.Net, no don't use VB.Net, it's C#, No don't use Windows Forms, it's WPF, no it's not WebForms, it's MVC, Forget about WPF and forget about C#, it's HTML5 & js, Forget all of it, today it's Win8 & WinRT ...

Then they have these yearly techdays events around the world when they come to ram into your throat all the new stuff they are selling the community like crap, and we programmers are supposed to applaude it. And then the community goes home and gets scared ... Forums get filled with 'Will their be a future for C#', 'Does WPF still have a future', etc.

They way I see it, is that the past ten years, Microsoft has done nothing but trying to immitate innovations made by competitors and open source communities in an effort to smash this competition down, and in doing so they are constantly screwing their own imitations of two/three years before with a 'this is better merchandise', and they are expecting that their followers/customers swallow all of this like candy.

Microsoft doesn't give a damn about building stable long enduring development environments as in the days of old, they only want to knock down all competition by imitation and claiming the imitation is their invention ...

Microsoft management is that of a kid requesting toys from Santa Claus. I want this, no I want that, and this, and I want that too. Sorry, you can't have it all. Microsoft is becoming a balloon. More and more air is piled up in it ... The question is, when will it explode ... When comes the time that the community will stand up and say ... Enough is enough, give us a programming model that doesn't last for three years, but one that will be supported for years to come. Make up your mind and choose ...

But they won't ... They value their competitor's customers more than their own. Which is why they have officially named positions like 'Tech Evangelist'. It's about converting the world to Microsoft. Once converted, they no longer care about the converted one.
Left by Daniel on Oct 20, 2013 6:55 PM

# re: .NET vs Windows 8
Requesting Gravatar...
Well said, Daniel!
Left by D on Jun 11, 2014 8:23 PM

Your comment:
 (will show your gravatar)

Copyright © simonc | Powered by: