Link: Dare Obasanjo aka Carnage4Life – On the Release of the Source Code of the .NET Framework Libraries

As usual, someone else has already written it: Dare’s piece on this announcement reflects my views exactly.  Since I’ve been playing with Java lately (see previous post) I’ve become used to the idea that I can jump straight into the source for almost anything, certainly for the JDK libs.

Still, most of us I’m sure would agree that this is a Good Thing, both in purely practical terms for working programmers, and on another level, more evidence that Microsoft is beginning to ‘get’ some of the things the other side of the industry managed to ‘get’ long ago.

There’s another way the developer will surely benefit: being able to read through the real code is the best way to appreciate and absorb the good design principles enshrined in (most of) the .NET Framework libraries.  The principles which guided the team are described in the excellent Framework Design Guidelines book by Cwalina and Abrams, a book I’d recommend even to folk who don’t use the Microsoft platform.  True, you can use Reflector to reverse the libraries, but the original source will presumably retain comments, which may reveal subtleties around intent, choices and so on.

I use Google Docs and Google Reader all the time. With Google Gears, these are set to become even more useful because they’ll work when I’m offline. The Reader already works this way (see this post for more), but not Docs + Spreadsheets yet. Rumour has it that this is coming. If they solve the sync problem properly, this will be seriously good: Docs is fine for note-taking and certainly good enough for blog posting. And of course they must extend Gears to GMail.

Web 2.0, Ajax + Gears (+ whatever server-side stuff you use to generate all this) may be good enough technology for building browser-applications which work offline, but underneath the covers it’s still based on HTML, grinding out a ton of hard-to-debug JavaScript, and running inside the browser frame. For the poor developer, even though dedicated folk spend hours creating libraries like script.aculo.us (and Google’s own GWT ) the experience of creating these applications remains pretty dire. And the result of all this extraordinary effort is still something which doesn’t even approach the sophistication of the equivalent desktop application. As I said, I really like Google Docs, but it isn’t Word, and won’t ever be.

Then there’s Adobe Flash and ActionScript, which has been around for a long time, is well established and has been used to create quite complex browser-hosted applications, such as Gliffy, which is (a bit) like Visio in a browser frame. Flash is cross-platform, as well as cross-browser, but still there’s quite a gap between developing for Flash, and developing for the desktop. Now Adobe Labs is promoting AIR (the technology formerly known as Apollo). This looks like a warmed-over Flash, and appears to be based still on JS and HTML.

When I first heard about Silverlight, I wondered why Microsoft appeared to be tilting at the Flash/ActionScript windmill? Why would they expect developers of browser-hosted, graphical presentations to switch away from Flash? But that’s not really what Silverlight is about: this is about creating a platform for Rich Internet Applications (RIAs) based on the .NET platform, which makes this potentially much more interesting, especially if development can be done in C# using Visual Studio, rather than mashing together markup and script. The runtime appears to be a a slightly reduced version of the CLR, supporting WPF/XAML as well as the traditional HTML/JS mixture. Quite remarkable, in a 1.1MB download. Rather than repeat more technical details here, I’ll refer you to the Silverlight architecture summary paper.

Silverlight already runs on Mac as well as Windows, and in all the popular browsers. Could it be ported to Linux/Unix? The Mono project has proved the portability of the runtime, so it doesn’t sound like such an outrageous suggestion.

I was about to start writing a tool to do this when it occurred to me that someone else must have done this already. Googling located two solutions:

  1. DOTNET2UML from AgileFactor, see this page.
  2. Xmi4DotNet, see this page.

Of these, (1) seems to be out of date and doesn’t handle .NET 2.0, so it’s no good to me at all. Option (2) appeals the most because it’s an addin for Reflector. Trouble is, the current version of Reflector won’t load it! I haven’t time to work out why, but looking in the Google code issue list for this project, someone has reported this error already. Would be nice to see this fixed. I’d quite like to write code to do the reflection + generation myself, but it’s just a distraction I can’t afford right now.

The Netron project (Sourceforge) has disappeared.  It looks like the author has sold out to (or been employed by) Northwoods Software.  Good luck to him, I guess.  I used Netron for a while, but found it frustratingly patchy and the author seemed more preoccupied with adding features and presenting a lot of demo apps rather than with quality.  What’s the alternative, in the .NET world? 

I’m not usually drawn to online ‘Java versus .NET’ discussions.  They tend to attract evangelists and bigots, and rarely lead to any insight.  This article on TheServerSide is a little better than most; there is still a hefty proportion of noise, but enough signal gets through to make it worth reading a selection of the follow-up comments (I have only managed to get about half way through, skim-reading).  Quite a few of the comments reinforce my own views, hence this post.

Software engineering is (or should be) about getting things done – creating and delivering something.  You use the tools and techniques which work well for you, in your environment.  In my view, Java and .NET are roughly equivalent in terms of their ability to enable delivery.  You cannot guarantee success by choosing one technology over another, but you can improve your chances: you select the one which most closely fits your circumstances.  This piece of common-sense at least emerged from some of the comments.  If your business (therefore your customer’s) is tightly bound to the Microsoft platform, then .NET probably makes good sense for you, regardless of engineering-purity arguments in favour of an alternative.

The breadth-of-choice issue, in relation to Java frameworks, libraries and technologies (and even IDEs), is an understandable point, but I see this is as one of Java’s great strengths. The Microsoft monoculture means you don’t have to think for yourself, and for many a jobbing programmer, this is a good thing. What’s needed is strong technical leadership where decisions concerning the language, tools and technologies to be used by default are made by senior engineering, following some process of study and selection. With the burden of technology-selection drastically reduced (even removed), development teams can get on with applying the selected technology, gaining experience with it and feeding-back into an iterative improvement process managed by the technical leaders. 

Some will complain that this smacks of a ‘two-tier’ technical hierarchy, with certain individuals occupying elevated positions and having control of process and technology.  Well, yes, that is exactly what I am suggesting.  I don’t see a workable alternative that doesn’t result in, at best, less effective teams constantly trying different things, and at worst, complete chaos.  It doesn’t mean the leaders are always right, and (as the hint at an iterative process indicates) it doesn’t mean things can’t change.

This article is timely because I have only recently started trying to use Java and Eclipse, after many years of C# and .NET.  I can sympathise with the .NET enthusiasts because I am at the stage where I know how to do it using C#/CLR but I’m not quite sure of the best way to do it using Java.  As it happens, I don’t think the range of alternatives is daunting at all: it looks to me as if I can go a long way with Eclipse (with additional libraries), Spring and Hibernate.  What continues to amaze (and delight) me is the range and quality of supporting libraries in the Eclipse space: there is no equivalent in the Microsoft world.