Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News BCL Changes in .NET 4

BCL Changes in .NET 4

Leia em Português

This item in japanese


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