The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer.
 Friday, May 16, 2003
More .NET Purity discussions...

Lots of good debate and discussion on the Myth of .NET Purity from a number of very nice people as well as some nice links and comment threads.

Some people were a little taken aback and invoked Rotor and Mono to illustrate the importance of Purity and Code Portability.  I replied in a few comments posts, but re-print my position here:

One fellow agreed and said "If you want to do cool stuff the vise gets a bit tighter."

Another fellow mentioned the JVM and the CLI to which I responded: Note that you started using "CLI" in your sentence, rather than the ".NET Framework" or the "CLR." Certainly the CLI (common language infrastructure) as a concept is great and is obviously portable, having been ported as Mono and Rotor. But I'm not talking about the CLI. Rather, we should remember the underneath any layer of abstraction (leaky or not) there is an implementation. The point of my article was to remind folks that the Microsoft Windows implementation - the CLR and .NET BCL (base class library) - depend HEAVILY on the underlying behavior, libraries and services of the Windows OS. Code Portability (certainly desirable for some, less so for others) is certainly possible at the C# and IL level, but writing cross CLI implementation C# is no different than writing cross platform "C." Think about that. When writing cross platform code (often confused with 100% whatever, and there's a difference!) one has to consider: compiler behavior, interfaces, the OSs underlying implementation of the API, the level at which the API was written, etc.

One surely can't expect a very complex C# Winforms app with all the fancy GDI+ goodness and user controls to just work on Mono (unless I'm missing something) - not until the underlying implementation of ALL the dependancies are written and implementing using whatever Linux OS primitives are required to provide these features.

My rant was originally prompted by a fellow who was saying that he was writing some WinForms to ASP.NET Web Services app and that he was writing it in "100% Pure .NET" to INSULATE HIMSELF FROM RISK in some way. Like he'd be protected and have code portabilty if he just made sure to do it all in .NET. And that is a Myth. Code and life are a lot more complex than a sound bite like "100% .NET." - Scott Hanselman


Updated Link to this post 2:25:56 PM  #    comment []  trackback []