Below are a few thoughts on the upcoming framework 4.0. I am not sure if the feature set is finalized, but I’ll comment on what I think are some of the more interesting features being planned for this release, as seen in the beta.
Managed Extensibility Framework
Plug-in architectures are a fairly common pattern for many scenarios, and I have seen quite a few over the years. MEF seems to be a nice combination of plug-in/IoC container/Dependency Injection framework. It’s use in Visual Studio 2010 should prove to give this framework a leg-up. I’m looking forward to using it as a replacement to the typical roll-your-own plug-in architecture. Not sure if it will be used where a complete dynamically composed extensible application is called for, however, that is exactly the scenario that MEF is designed for. I’ll see how it works out for plug-ins, first, before jumping in with both feet.
Language Enhancements
Some of these are obvious improvements: Optional arguments, COM interop/PIA enhancements. Some are welcome, such as named parameters. As for the new dynamic language features in C# ... well, I’m not qualified to comment on that yet. Interoperability with dynamic languages is a good thing. Whether or not I’ll be writing “dynamic c#” in the near future remains to be seen.
Base Class Library
I’ve blogged about one new class, the Memory Mapped File, in the recent past. There are a host of additional improvements, including the inclusion of the Task Parallel Library (TPL) that I believe came out of Microsoft research and has been release in CTP form a few times. Code Contracts look interesting, but I seriously doubt I will be adding pre-conditions, post-conditions and the like to very much code. I suppose there is a use for this – for some types of code; but I don’t see it for typical use. I had some experience with Eiffel in the past and did not care for it.
More Framework, Less P/Invoke
I would like to see more framework and less P/Invoke, particularly for new technologies such as those introduced in Windows Vista. There are managed wrappers provided for many things from Microsoft, but how about adding Windows 7 stuff to framework 4.0? It’s fine that wrapper libraries appear on CodePlex, but I would like to see the kind of treatment you would get from including new APIs in the framework – the way the System.Net.Sockets namespace is not simply a wrapper around the Win32 sockets API. I know, it’s hard – but what else is windows except a platform for development? If I was looking for merely an OS to run standard applications on, I could look elsewhere. Windows is first and foremost an application development platform for me. And for applications, I prefer managed code. Leave the C code (and COM goo) for drivers and low-level applications like virus scanners.
Visual Studio 2010
This looks like a big change. I’ll probably be using this for R&D (and also at home). But will probably wait about a year (or more) before converting all development projects over to vs2010. Although the beta seems pretty solid, my experience is that the first of a major change (vs2002/2003, the initial vs2008) in the Visual Studio line is not the greatest (contrast to vs6, vs2005 and now 2008/SP1). I love two things: multi-targeting and the ability to run different visual studio versions side x side. I expect that experience to be kept in vs2010. This allows developers to install the new tools with “no fear”, committing to them down the road. Goes a long way to increase adoptability. All that being said, the C++ team is saying “10 is the new 6”, and MSBuild can now be used for C++ code, etc., etc. I’ll keep an eye on thing in 2010.
F#?
Don’t know about this one. I’m thinking that the pile of technologies that I am now “expert” in is getting a little too large. However, I believe in the mantra “learn a new programming language every year”. It can be a bit confusing to switch from maintaining classic C code, early C++ code (mostly C with sprinkles of C++, MFC/ATL), later C++ code (STL, etc.), some VB6 and VBscript in classic ASP or office apps; then perform new development in JavaScript, C#, Windows Forms, WPF, Silverlight, and ASP.net. with a sprinkling of objective C for an iPhone app or two (quite a mix of frameworks and languages in that sentence, but you get the idea). I love it all. I’ll have to work F# in somewhere, because a functional language perspective brings new thought patterns, which is always a good thing. I suppose I’m glad it’s in the box, although at first thought I might want IronRuby or IronPython in there instead. I don’t see any production apps developed in F# in the next year or two, but an R&D project is likely.
- - - -
I have to admit that I have not played all that much with the beta; been pretty busy over the past few months. But I’m looking forward to framework 4.0, and expect it will turn out to be a significant release.