BT

InfoQ Homepage News BCL Changes in .NET 4

BCL Changes in .NET 4

Bookmarks

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
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.

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

Community comments

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

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

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.