In Tune with C#

Some people might see Microsoft's new C# language as a backlash against Sun Microsystems' lawsuit against Microsoft over Java. C# (pronounced "C sharp") is currently in beta, and Microsoft plans to release it initially as part of Visual Studio.NET. However, Microsoft intends C# to be, like its musical namesake, one step above C. The new C# language combines Visual Basic's (VB's) ease of use with Visual C++'s (VC++'s) power and flexibility. C# also incorporates Java's most important language features.

C# is a fully object-oriented language that should be familiar to VC++ developers. However, C# introduces several new features, including type safety and automatic garbage collection, while simultaneously eliminating frequently troublesome concepts such as pointers and multiple inheritance. C#'s type safety doesn't allow unsafe casts (data conversions), requires all objects to have valid references, and always initializes dynamically allocated variables to zero. With automatic garbage collection, you don't have to manually implement destructors for every object, and C# automatically removes from memory all objects that a program no longer references.

Pointers, while powerful, can also be a constant source of problems, as C programmers can tell you. Like Java and VB, C# doesn't support pointers when producing managed code. C# developers have also left out support for multiple inheritance—a source of potentially unending confusion. C# supports all other object-oriented features, such as polymorphism, encapsulation, and standard inheritance. You can download the complete C# language reference at /nextgen/technology/csharpdownload.asp.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.