oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

What Is C#

by Jesse Liberty, author of Programming C#,
4th Edition
and Visual C# 2005: A Developer's Notebook
Help Me Help You
C# is a type-safe, component-based, high-performance language that is designed for the Microsoft .NET framework. C# 2.0 is the new generation of C#, upgraded with Generics and other advanced features and fully integrated into .NET 2.0 and Visual Studio 2005. If you are developing Windows or web applications or web services for the .NET platform, C# is in many ways the language of choice.

This article discusses the following:

  1. The .NET Platform
  2. The C# Language
  3. Coding with C#

While Microsoft and its competitors are always innovating and creating new ways to approach programming, about every ten years or so an approach so revolutionary comes along that it totally changes not only the way we program, but the way we think about programming.

In the early 1980s, the new technologies were Unix and a powerful new language called C. The early '90s brought Windows and C++. In 2000, .NET and C# were the next wave. Each of these developments represented a sea change in the way we approached programming.

.NET and C# have matured greatly in five years, and the new versions, C# 2.0 and .NET 2005, represent a significant increase in productivity and a good opportunity to examine C# closely to understand what it is. This is especially important because C# is arguably the primary language for programming in .NET (alongside Visual Basic 2005) and Microsoft has "bet the company" on .NET.

When a company of Microsoft's size and influence spends billions of dollars a year on R&D, and reorganizes their entire corporate structure to support a new platform, programmers are required to take notice. The term ".NET" has been overmarketed by Microsoft, but the part we care about amounts to a new operating system layered on top of the existing Windows platform (allowing for backward compatibility while creating a new object-oriented operating system) and the development tools created to facilitate development for that platform.

The nasty little secret about .NET is that Microsoft really created only one language for the .NET platform. This language is called Microsoft Intermediate Language (MSIL). They then created two coatings for MSIL. One looks a lot like C++ or Java, and they named it C#; the other looks a lot like VB6 and they named it VB 2005. Both C# and VB 2005 produce MSIL, and it is MSIL that runs on the .NET platform.

C# 2.0 comes with updated tools and a powerful new development environment. It is the crowning achievement of Microsoft's R&D investment. And it is wicked cool.

The goal of C# 2.0 is to provide a mature, simple, safe, modern, object-oriented, internet-centric, high-performance language for .NET development. In much the way that you can see in young children the features and personalities of their parents and grand­parents, you can easily see in C# the influence of Java, C++, Visual Basic (VB), and other languages, but you can also see the lessons learned since C# was first introduced.

The .NET Platform

The .NET platform is a development framework that provides a new application programming interface (API) to the services and APIs of classic Windows operating systems while bringing together a number of disparate technologies that emerged from Microsoft during the late 1990s. This includes COM+ component services, a commitment to XML and object-oriented design, support for standardized protocols such as SOAP, WSDL, and UDDI, and a focus on the internet.

Since all .NET Common Language Specification compliant languages (like C#) produce MSIL, you can inherit from classes, catch exceptions, and take advantage of polymorphism across different .NET languages. The .NET Framework makes this possible with a specification called the Common Type System (CTS) that all .NET components must obey. For example, everything in .NET is an object of a specific class that derives from the root class called System.Object. The CTS supports the general concepts of classes, interfaces, and delegates (which support callbacks).


The most important component of the .NET Framework is the Common Language Runtime (CLR), which provides the environment in which programs are executed. The CLR includes a virtual machine that creates, manages, secures and cleans up after objects. The CLR is a set of framework classes that include a layer for data (ADO.NET) and for XML. On top of all this, the CLR creates a layer for three types of applications: Windows desktop applications, web Applications and web services (see future article, "What Are Web Services?").

The classes that Microsoft provides to support these applications and to provide the "plumbing" for network operations, threading, database interaction, creating the user interface and so forth, are called the Framework Class Library (FCL). The .NET FCL is one of the largest class libraries in history; it provides an object model for all the functionality of the .NET platform. With more than 4,000 classes, the FCL facilitates rapid development of both desktop and web applications.

How to Keep Your Boss from Sinking Your Project

Essential Reading

How to Keep Your Boss from Sinking Your Project
By Andrew Stellman, Jennifer Greene

Like it or not, your project needs management. Yet few good software projects can survive bad management. If you're a programmer on a high-visibility project, this PDF offers five principle guidelines for managing upward that will help you help your boss make the right decisions about setting project expectations, working with users and stakeholders, putting the project on the right track and keeping it there. The PDF also covers what problems cause projects to fail and how to fix them, and what you can do to keep your software project from running into trouble.

Read Online--Safari
Search this book on Safari:

Code Fragments only

Pages: 1, 2

Next Pagearrow