The XML Comment Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
Compiling Documentation Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868
An XML Documentation Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871
Preface
W
e programmers are a demanding bunch, always looking for ways to improve the
performance, efficiency, and portability of our programs. We also demand much
from the tools we use, especially when it comes to programming languages.
There are many programming languages, but only a few are great. A great programming
language must be powerful, yet flexible. Its syntax must be terse, but clear. It must facilitate
the creation of correct code while not getting in our way. It must support state-of-the-art
features, but not trendy dead ends. Finally, a great programming language must have one
more, almost intangible quality: It must feel right when we use it. C# is such a language.
Created by Microsoft to support its .NET Framework, C# builds on a rich programming
heritage. Its chief architect was long-time programming guru Anders Hejlsberg. C# is
directly descended from two of the world’s most successful computer languages: C and
C++. From C, it derives its syntax, many of its keywords, and its operators. It builds upon
and improves the object model defined by C++. C# is also closely related to another very
successful language: Java.
Sharing a common ancestry, but differing in many important ways, C# and Java are
more like cousins. Both support distributed programming and both use intermediate code
to achieve safety and portability, but the details differ. They both also provide a significant
amount of runtime error checking, security, and managed execution, but again, the details
differ. However, unlike Java, C# also gives you access to pointers—a feature supported by
C++. Thus, C# combines the raw power of C++ with the type safety of Java. Furthermore,
the trade-offs between power and safety are carefully balanced and are nearly transparent.
Throughout the history of computing, programming languages have evolved to
accommodate changes in the computing environment, advances in computer language theory,
and new ways of thinking about and approaching the job of programming. C# is no exception.
In the ongoing process of refinement, adaptation, and innovation, C# has demonstrated its
ability to respond rapidly to the changing needs of the programmer. This fact is testified to
by the many new features added to C# since its initial 1.0 release in 2000.
Consider the first major revision, C# 2.0. It added several features that made it easier for
programmers to write more resilient, reliable, and nimble code. Without question, the most
important 2.0 addition was generics. Through the use of generics, it became possible to create
type-safe, reusable code in C#. Thus, the addition of generics fundamentally expanded the
power and scope of the language.
Now consider the second major revision, C# 3.0. This is the latest version of C# and is the
version described in this book. It is not an exaggeration to say that C# 3.0 has added features
that have redefined the very core of C#, raising the bar in computer language development in
the process. Of its many innovative features, two stand out: LINQ and lambda expressions.
LINQ, which stands for Language Integrated Query, enables you to create database-style
queries by using elements of the C# language. Lambda expressions implement a functional-
style syntax that uses the
=>
lambda operator, and lambda expressions are frequently used in
LINQ expressions.
As you will see in the course of this book, the combination of LINQ and lambda expressions
represents a radically powerful subset of C#. Furthermore, they are revolutionary features that
xxiii
www.freepdf-books.com
xxiv
C # 3 . 0 : T h e C o m p l e t e R e f e r e n c e
are redefining how solutions are crafted for many different types of programming tasks, not just
database queries. In essence, they let you approach old problems in new ways. Their use not
only streamlines a solution, but also helps you conceptualize a problem from a different point
of view. Simply put, the addition of LINQ and lambda expressions is both significant and far
reaching. They are changing the way we think about the job of programming.
Because of its ability to adapt rapidly to the changing demands of the programming
landscape, C# has remained a vibrant and innovative language. As a result, it defines one
of the most powerful, feature-rich languages in modern computing. It is also a language
that no programmer can afford to ignore. This book is designed to help you master it.
What
’s Inside
This book describes C# 3.0. It is divided into two parts. Part I provides a comprehensive
discussion of the C# language, including the new features added by version 3.0. This is the
largest part in the book, and it describes the keywords, syntax, and features that define the
language. I/O, file handling, reflection, and the preprocessor are also discussed in Part I.
Part II explores the C# class library, which is the .NET Framework class library. This
library is huge! Because of space limitations, it is not possible to cover the entire .NET
Framework class library in one book. Instead, Part II focuses on the core library, which is
contained in the
System
namespace. Also covered are collections, multithreading,
networking, and Windows Forms. These are the parts of the library that nearly every C#
programmer will use.
Do'stlaringiz bilan baham: