Click here to monitor SSC

Laila Lotfi

.NET tools Brand Manager & Simple-Talk Editor

Back-sliding into Unmanaged Code

Published Friday, February 26, 2010 4:51 PM

It is difficult to write about Microsoft's ambivalence to .NET without mentioning clichés about dog food.  In case you've been away a long time, you'll remember that Microsoft surprised everyone with the speed and energy with which it introduced and evangelised the .NET Framework for managed code. There was good reason for this. Once it became obvious to all that it had sleepwalked into third place as a provider of development languages, behind Borland and Sun, it reacted quickly to attract the best talent in the industry to produce a windows version of the Java runtime, with Bounds-checking, Automatic Garbage collection, structures exception handling and common data types. To develop applications for this managed runtime, it produced several excellent languages, and more are being provided. The only thing Microsoft ever got wrong was to give it a stupid name.

The logical step for Microsoft would be to base the entire operating system on the .NET framework, and to re-engineer its own applications. In 2002, Bill Gates, then Microsoft Chairman and Chief Software Architect said about their plans for .NET, "This is a long-term approach. These things don't happen overnight." Now, eight years later, we're still waiting for signs of the 'long-term approach'. Microsoft's vision of an entirely managed operating system has subsided since the Vista fiasco, but stays alive yet dormant as Midori, still being developed by Microsoft Research. This is an Internet-centric fork of the singularity operating system, a research project started in 2003 to build a highly-dependable operating system in which the kernel, device drivers, and applications are all written in managed code. Midori is predicated on the prevalence of connected systems, with provisions for distributed concurrency where application components exist 'in the cloud', and supports a programming model that can tolerate cancellation, intermittent connectivity and latency. It features an entirely new security model that sandboxes applications for increased security.

So have Microsoft converted its existing applications to the .NET framework? It seems not. What Windows applications can run on Mono? Very few, it seems. We all thought that .NET spelt the end of DLL Hell and the need for COM interop, but it looks as if Bill Gates' idea of 'not overnight' might stretch to a decade or more. The Operating System has shown only minimal signs of migrating to .NET. Even where the use of .NET has come to dominate, when used for server applications with IIS, IIS itself is still entirely developed in unmanaged code. This is an irritation to Microsoft's greatest supporters who committed themselves fully to the NET framework, only to find parts of the Ambivalent Microsoft Empire quietly backsliding into unmanaged code and the awful C++. It is a strategic mistake that the invigorated Apple didn't make with the Mac OS X Architecture.

Cheers,

Laila

by Laila

Comments

 

timothyawiseman@gmail.com said:

You make some very interesting points, and I would love to see Microsoft make greater use of the .NET solutions that it introduced.

Still, it can take a large amount of time to rework an entire operating system and legacy code can be hard to remove after it is burriedly deeply in the core.  C# and IronPython are both excellent langauges for the things they do well.
February 26, 2010 11:24 AM
 

Jason Haley said:

Interesting Finds: February 27, 2010
February 27, 2010 7:14 AM
 

mrwcjoughin said:

SQL Management Studio has been written in .Net since 2005, and (finally) Visual Studio is with 2010. Since they've gone through all the pain with Visual Studio, perhaps that will encourage them to do office next ?
March 1, 2010 12:53 AM
 

martinhalford said:

Hi Laila,

Loved your Editorial in the latest Simple-Talk Reflector Newsletter.  Agreed with everything you said except….
… I was a little curious about your statement “It is a strategic mistake that the invigorated Apple didn’t make with the Mac OS X Architecture.”
Have you ever tried programming in Objective-C ?!  It is to Mac OS X what C++ is to Windows - a language anchored in the 80’s with all the same unmanaged code issues as C++. Like Microsoft, the challenge of replacing it with a managed language was too hard a task.  Admittedly Apple never made any promises that they were going to do such a thing (at least, that I know of).  

However, unlike Microsoft, the guys and gals at Cupertino don’t rely on developer loyalty.  They rely on customer loyalty which forces developers to use their limited and somewhat clunky toolsets.   In addition, Apple controls both the hardware and software sides of the equation, thereby limiting the combinations and permutations their unmanaged code has to handle.

Just my 2 cents worth…..
March 1, 2010 6:06 AM
 

Daniel Polistchuck said:

As far as I can see, I wouldn't expect Microsoft to write an operating system in .Net. Every other OS in the market is written in a combination of C and assembly (and maybe some other natively compiled language such as Objective C or C++). That's true for Windows, Linux, Unix, BSD, Solaris, Mac-OS. The overhead of managed code at the kernel level would be too resource taxing.
Managed code is great for User level code such as desktop and business oriented apps.
If Midori is fully managed, I'd be (curiously and positively) surprised to see it leaving the lab cages.
March 1, 2010 6:13 AM
 

Octagon said:

VS 2010 does not look like implemented in .NET to me. The user interface was reworked in WPF and that is all so far. There is a very good Microsoft presentation on that, but I do not remember the URL. In essence, it says "this is how we got new nice UI features and that was surprisingly easy".

My impression is that MS is building with .NET around Silverlight now. It looks like a parallel safe net-centric OS is being created.
March 1, 2010 7:33 AM
 

Andrew Clarke said:

Posted on behalf of Dave.

Exchange Server 2007 and the forthcoming Exchange Server 2010 are written entirely in managed code, except for the backend storage engine. All the management tools, all of the services, Outlook Web Access, etc. All of it is managed code. They are vigorously working on transforming the backend storage engine into managed code for a future release. At that time, only the database interface itself will be unmanaged code (“Jet”, which is part of the operating system).

The transition to managed code is a scary decision to make. There are perceptions of lower performance (which is easy to attain, and difficult to avoid), it certainly requires rewriting everything you’ve got, and in many cases, there’s nothing new to offer the customers. I mean, “Here, you’ve waited three years for the new version of <product X> and it offers nothing new! Yes, it’s written in Managed Code now, which means nothing to you since you’re not developers, but we promise that this change means we’ll be able to innovate faster for future versions, but this is what we have for you now.” The market usually doesn’t react well to such a statement. Unless the team is able to a) rewrite everything in managed code and b) come up with a bunch of compelling new features and c) do all of this in the same amount of time it would have taken just to write the new features alone, you’ve put yourself in a very difficult position in the market. The Exchange team pulled it off in 4 years, and then the “new features” were really a new management model (use Powershell) and the promise of faster innovation. Exchange 2010 delivers on that promise by having far more new interesting features than could have been done in the same intervening 3 years since Ex2007 was released.

To be fair, there are little bits of unmanaged code still in Exchange. Some of it will not go away in any measurable amount of time for precisely the reasons given below. There aren’t enough resources to do the conversion, and even if done, it buys nothing for anybody beyond the pride note of having done it. But to support my overall claim, the ratio of unmanaged to managed code is very small. Once the backend storage engine completes its conversion, the ratio will be microscopic (1 or 2 small DLLs, and that’ll be it).

               Dave
March 1, 2010 9:19 AM
 

davidrostcheck said:

Hi Laila, Martin Halford is absolutely right - Apple is in even worse shape; their entire toolchain is unmanaged, coding in it is very tedious, and there is no path to managed code on their (published) horizon. They are making some attempts to add garbage collection to Objective C, but it's a limited approach. Futher, Microsoft's new products tend to be managed (such as Dynamics CRM), although they are definitely maintaining the existing moneymakers in C++. That's not surprising; the investment there is too deep to easily justify a rewrite. ALso, they do not need to rewrite the OS in managed code; what they really need is a stripped-down OS that only runs .NET, discards support for all the legacy technologies (registry, COM), and improves the file system.

In fact, if I ran Microsoft, I'd be developing Microsoft .NETOS (and I'd do it on top of a Linux/Unix core, as Apple did; it's a more modular core and the heavy lifting is all done). Ironically, Microsoft has even more to gain from an Open Source initiative than Apple did, because .NET really does rule the roost as an application development platform; it would position them centered over their strength. The real question is whether the business will be able to embrace such a perspective shift when Windows and Office are still such heavy moneymakers and wield such gravity in their strategic planning.
March 1, 2010 10:23 AM
 

BuggyFunBunny said:

>>  In fact, if I ran Microsoft, I'd be developing Microsoft .NETOS (and I'd do it on top of a Linux/Unix core, as Apple did

Not quite.  OS X is Mach/BSD derived.  Neither Stevie nor Ballmer want the GPL lawyers looking over their shoulders.
March 1, 2010 2:21 PM
 

davidrostcheck said:

Sorry, read that as "Linux or Unix" (I'm aware BSD is a Unix).
March 1, 2010 5:18 PM
 

AndyDent said:

I've just finished a major port of a classic Mac OS application to a core DLL with GUI in WPF, connected via C++/CLI. This gives me a good perspective on where .Net technologies sit vs plain C++ and also Objective-C (the port was potentially a Cocoa port which we decided to do differently).

I agree with many of your posters above but with the caveat that productivity is not just about the language but also the frameworks and anyone sneering at Objective-C is discounting Cocoa. I personally prefer using Objective-C++ which is a lesser known option, allowing clean use of C++ as a better C for the bits of code which aren't just concerned with Objective-C messaging.

I think the toolchain in Visual Studio and the declarative nature of WPF are much better for team development than Apple's tools and Cocoa. In terms of individual productivity, I suspect that skilled individuals are probably roughly equal but wouldn't be surprised to see the Cocoa guru pull in front. Give WPF another few years to stabilise and some of the idioms of C# 3 and 4's new features to settle in and I think that will change.

In terms of Microsoft's future "managed OS", I'm certain it's a Silverlight shining down from an Azure-tinted cloud.
March 9, 2010 7:10 AM
You need to sign in to comment on this blog

About Laila

I'm working for the .NET Tools division at Red Gate. These days, I'm spending most of my time working on SmartAssembly (.NET obfuscator, error reporting and feature usage reporting tool), and I'm currently looking to speak to anyone who has used the product for its error reporting technology. My email address: editor@red-gate.com
<February 2010>
SuMoTuWeThFrSa
31123456
78910111213
14151617181920
21222324252627
28123456
78910111213
Migrating from OCS 2007 R2 to Lync: Part 4
 Having migrated the rest of our users and legacy resources across, and start getting ready to... Read more...

Automated Script-generation with Powershell and SMO
 In the first of a series of articles on automating the process of building, modifying and copying SQL... Read more...

Seth Godin: Big in the IT Business
 Seth Godin has transformed our understanding of marketing in IT. He invented the concept of 'permission... Read more...

Using SQL Test Database Unit Testing with TeamCity Continuous Integration
 With database applications, the process of test and integration can be frustratingly slow because so... Read more...

Converting String Data to XML and XML to String Data
 We all appreciate that, in general, XML documents or fragments are held in strings as text markup. In... Read more...