Updates in the .NET Framework 4.5

I try hard to follow the latest developments in all of the technologies that interest me. Since my range of interests is large, sometimes it proves nearly impossible to track it all. So, like you, I rely on summaries of information at times. I’ve been working with Visual Studio 2012 quite a lot lately. Not only is it the tool of choice for other authors and the tool I’ll use to write books myself, but I also need to verify that the source code for my currently supported books still works. The new features in the associated .NET Framework 4.5 are of great interest to me, so I checked out an article about it entitled, “What’s New in the .NET 4.5 Base Class Library” by Immo Landwerth.

There are a lot of welcome updates. For example, asynchronous programming won’t be as difficult in the future because Microsoft has taken measures to simplify things. You can read the article yourself to see how much better the new technique is. I’m sure that many developers will welcome the change because it will make it possible for developers to create asynchronous routines with greater ease, which should make applications considerably more responsive. Given that one of the five tenets of Metro programming is to be fast and fluid, it doesn’t surprise me that .NET 4.5 contains this sort of change. I worked through the example and even tried a few of my own and the new asynchronous support works great! However, I have to wonder what the cost of this new support is. It isn’t often that you get simplicity without the loss of flexibility. As I explore this new feature, I’ll let you know if I do come up with reasons to use the old approach (as nice as the new approach is).

The new ZIP file support strikes me as something Microsoft added because everyone else already has it. Microsoft was late to the party with this one. However, the new support is quite welcome because ZIP files have proven to be a problem in the past. Not many applications can get by without this particular archive today. What I had hoped would happen is that Microsoft would build an extensible archive support feature that would support ZIP files, but would also make it incredibly easy to add support for other archive file types, such as JAR and TAR. Unfortunately, it looks like we’ll see one new archive file format supported at a time.

I’ll need to play with the read-only collections to determine how I’ll use them. Right now, it appears that this new feature will see limited use in my applications (if I use it at all). The first two improvements mentioned in this post have a definite use in my applications and I’m welcoming them with open arms. What I’d like to hear from you is how you’d use this new feature. Let me know what you think about it at John@JohnMuellerBooks.com.

Articles are problematic at times because the author often doesn’t have sufficient space to cover all of the details. I know that I’ve encountered this issue myself. The editor assigning the article might not have sufficient grasp of the material to make a good decision about it either. I wish that this article had been split into several parts because the author lists a number of miscellaneous improvements at the end of the article. If you read the article, make sure you check this list carefully because some of the improvements, such as Console.IsInputRedirected, Console.IsOutputRedirected, and Console.IsErrorRedirected properties, are quite interesting. I write a lot of console applications and utility application that provide a console interface. Having these properties available will make it possible for me to code applications that are more responsive to user needs.

I’ve noticed that Microsoft didn’t provide a full number update to the revision number in this case and the minor upgrade number is warranted. There are some nice changes to the .NET Framework 4.5, but nothing so exciting that you should rush out right now and start implementing it in your applications. It would be wise to carefully add this update to your applications to determine when it provides a true advantage and when there is potentially a loss of functionality or flexibility that makes the update a bad idea.