BT

BCL Changes in .NET 4

| by Jonathan Allen Follow 576 Followers on Oct 27, 2009. Estimated reading time: 1 minute |

Support for complex numbers is essential for any programming language used by mechanical and electrical engineers, as well as most scientific disciplines. This is why it was standard in languages dating back to FORTRAN. Strangely, it is missing from the .NET runtime, forcing developers to roll their own. While the class itself is simple, it makes it very difficult to mix libraries from different sources. The new System.Numerics.Complex class finally offers the common type needed for library interoperability.

Another interesting class is CivicAddress in the System.Device.Location namespace. The purpose of this class is to support geo-location system built into Windows 7 and accessed via the GeoLocationProvider. While technically not meant to act as a generic base class for addresses, it could be used for that purpose.

Many of the key base classes also picked some frequently requested helper function. The Stream class finally has a method for copying from one stream to another. TryParse methods have been added to Guid, Version, and Enum. Enum also picked up a HasFlag method to make reading flags easier. String adds a IsNullOrWhiteSpace method to compliment IsNullOrEmpty, which uses Char.IsWhiteSpace to evaluate the string. New overloads for Path.Combine, String.Concat and String.Join have been added to accept parameter arrays.

In order to make easier to support the many differences between XP, Vista, and Windows 7, there are now a lot more paths available via the Environment.SpecialFolder enumeration. There are also Environment functions for determining if the process and/or operating system is 64 bit.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Also check System.IO Improvements and code contracts in BCL by Nad e Ali Zaidi

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT