MSDN UK Team blog

Get all the latest Microsoft developer news, tools, downloads, tutorials and tips right here, every day.
Search Form
Unfiltered HTML
Developers code with microsoft

The Native Code Renaissance?

Unfiltered HTML
Unfiltered HTML

The Native Code Renaissance?

  • Comments 3

One of the topics that’s been seeing some discussion both inside and outside of Microsoft lately is the idea of a “renaissance” for native code. It’s not my term but I’ve heard it used in a number of places and Channel 9 has just started a new TV series called “Going Native”;

where the “renaissance” idea pops up again and again set against a backdrop of “modern C++”. That show has already seen over 60,000 viewings so, clearly, there’s a tonne of interest out there.

What’s going on?

Since around 2002 Microsoft has been pushing ahead on the .NET platform and it’s shown up pretty much everywhere. The range and breadth of places where you might write .NET applications is very broad;

  • Server-side web applications and services with or without plugging into IIS and/or using higher level frameworks like ASP.NET, Windows Communication Foundation and Workflow Foundation.
  • Those same kinds of applications running in the Windows Azure cloud.
  • Code running inside other server-side hosting environments like SQL Server, BizTalk Server and so on.
  • Business/consumer applications on the desktop using frameworks like Windows Forms, Windows Presentation Foundation & Silverlight.
  • Plug-ins on the desktop running in hosting environments such as Microsoft Office.
  • Apps on the Windows Phone using Silverlight.
  • Games on the desktop, Xbox and Windows Phone using XNA.
  • Applications running on typically small and resource constrained environments powered by the Micro Framework.

and I daresay that I missed a few – i.e. it’s everywhere.

I think it’s only fair to say that .NET is also in places beyond Microsoft like the Linux world opened up by Mono and the related technologies that show up in MonoTouch where .NET code is used for iOS development and in Mono for Android.

Did this massive rise of .NET over the past decade or so spell the end for native code and native code developers? 

 

Not really Smile

 

A tonne of native code was written before .NET arrived and a tonne of native code has been written and maintained since .NET arrived – it’s really the classic case of using the right tool for the job and both native and managed code have their place and there are both technical and business reasons for working with one, the other, or both.

My guess though is that this “renaissance” has its roots in a few trends that we’ve seen over the past few years.

The first is the undeniable growth of devices running applications written in native code – specifically the iOS powered iPhones and iPads which shows that there’s a lot of developers out there more than happy to begin new application work in native code.

The second is the raw power available in commodity hardware both in terms of the CPU but additionally, and especially, the GPU and it’s native code that’s offering the route to that power through exciting developments like C++ Accelerated Massive Parallelism that you can read about in Daniel’s post if you’ve not come across it before.

The third are the changes in the C++ language as it’s been modernising towards the updated C++ “0x” standard by adding features like lambdas, type inference and so on and there’s some great material around that on Channel 9 so I’ll finish up by linking to some of that material in case you’re interested in doing a bit of a catch-up.

As an aside – always remember on those Channel 9 videos that they have Smooth Streaming so if you full-screen the video you should get a higher bandwidth version of it and, failing that, you should be able to download them in various formats if online-viewing doesn’t work for you.

Here’s Herb “GOTW” Sutter ( whose C++ books still sit on my bookshelf ) talks through some of those advances in C++;

Boris Jabes talks about the evolution of C++ (at TechDays in Holland a few months ago);

 

C++ MVP Kate Gregory took some of those advances in C++ and talked about them in the context of Visual Studio 2010 ( at TechEd 11 );

 

 

Whether this is a “renaissance” or not, I honestly don’t know Smile but there’s certainly a tonne of activity going on in the C++ world and whether you write managed or native code, it’s always good to keep your eye on what’s going on in other communities as these ideas have a sneaky way of “cross-pollinating” from one world into another.

  • It's strange that in the "desktop-only" times MS was pushing towards the .NET which can me powerful across platforms and devices because it abstracts their differences well and now we are "urged" towards C++ :)

    About the points you make:

    1. The growth of iPhone is nice but if I am going to reuse code today I'll rather go MonoTouch than C++.

    2. If .NET lacks something (talking easily to GPU, etc) isn't it a very good case to add it to the .NET than to jump to whatever seems to support it?

    3. C++  as been modernising but even with its updates it will be behind C# 4, let alone coming versions. Also how is the new C++ supported across devices / dev tools? I feel that it'll be a case of using the smallest working subset for a long time coming.

  • kowd,

    I'm not trying to push you in a particular direction when it comes to C++ or .NET - I was just highlighting some things that I've heard people discussing and pointing to some interesting videos :-)

    As I said - it's a case of using the right tool for the right job.

    Mike.

  • I don't think there'll be a real "renaissance" for native code. It's just not practical to code in C++ for general purpose programming anymore. You can't achieve the kind of productiving in C++ that you can in C# or Java or other modern languages, especially when it comes to large business systems.

    That's not to say there's not a time and a place for native code. I've certainly written native code wrappers (including for apps that take advantage of GPUs) in C++ that I could then use from C#, but I try to do as little in C++ as possible. And I'll grant, especially with GPUs, you take a bit of an extra hit moving data from managed to unmanaged to GPU, back to unmanaged and back to managed code again. In some cases, I've kept the data mostly in unmanaged code and wrapped that in C#.

    I guess what I'm saying, I'd rather jump through some hoops to keep most of my code in C# than to write everything in C++. And more to the point, back when .NET 1.0 first came out, I was seriously considering getting out of the software development business (writing software is something I've been doing for over 30 years). C# rescued me from C++ hell. I was so tired of the tedium of C++. Keeping the stupid header files in sync with the cpp files. Jumping through all sorts of ridiculous hoops to deal with strings (ASCII & Unicode in the same app? Dear lord, what a nightmare).

    C# liberated me from the tedium of C++ and it renewed my passion for writing software. I'll still do C++ part-time, in a pinch, but I wouldn't do it full-time again. I'd change careers first.

Page 1 of 1 (3 items)
Leave a Comment
  • Please add 5 and 2 and type the answer here:
  • Post