Datasheet

Chapter 1
10
The .NET Framework has been designed such that it can be used from any language. This includes the
subject of this book, C#, as well as C++, Visual Basic, JScript, and even older languages such as
COBOL. In order for this to work, .NET-specific versions of these languages have also appeared:
Managed C++, Visual Basic .NET, JScript .NET, J#, and so on – and more are being released all the
time. Not only do all of these have access to the .NET Framework, they can also communicate with
each other. It is perfectly possible for C# developers to make use of code written by Visual Basic .NET
programmers, and vice versa.
All of this provides a hitherto unthinkable level of versatility, and is part of what makes using the .NET
Framework such an attractive prospect.
What's in the .NET Framework?
The .NET Framework consists primarily of a gigantic library of code that we use from our client
languages (such as C#) using object-oriented programming (OOP) techniques. This library is
categorized into different modules – we use portions of it depending on the results we want to achieve.
For example, one module contains the building blocks for Windows applications, another for network
programming, and another for web development. Some modules are divided into more specific sub-
modules, such as a module for building web services within the module for web development.
The intention here is that different operating systems may support some or all of these modules,
depending on their characteristics. A PDA, for example, would include support for all the core .NET
functionality, but is unlikely to require some of the more esoteric modules.
Part of the .NET Framework library defines some basic types. A type is a representation of data, and
specifying some of the most fundamental of these (such as "a 32-bit signed integer") facilitates interoperability
between languages using the .NET Framework. This is called the Common Type System (CTS).
As well as supplying this library, the framework also includes the .NET Common Language Runtime (CLR),
which is responsible for maintaining the execution of all applications developed using the .NET library.
How do I Write Applications using the .NET Framework?
Writing an application using the .NET Framework means writing code (using any of the languages that
support the framework) using the .NET code library. In this book we'll be using VS for our
development, which is a powerful integrated development environment that supports C# (as well as
managed and unmanaged C++, Visual Basic .NET, and some others). The advantage of this
environment is the ease with which .NET features may be integrated into our code. The code that we
will create will be entirely C#, but will use the .NET Framework throughout, and we'll make use of the
additional tools in VS where necessary.
In order for C# code to execute it must be converted into a language that the target operating system
understands, known as native code. This conversion is called compiling code, an act that is performed
by a compiler. Under the .NET Framework, however, this is a two-stage process.