Preface


We 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 longtime 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. For example, both support distributed programming, and both use intermediate code to achieve safety and portability, but the details differ.

Building on the strong foundation that it inherits, C# adds several important innovations that advance the art of programming. For example, C# includes delegates, properties, indexers, and events as language elements. It also adds syntax that supports attributes. Furthermore, C# streamlines the creation of components, eliminating the troubles associated with COM. One other point: Like Java, C# offers a significant amount of runtime error checking, security, and managed execution. However, unlike Java, C# also gives you access to pointers. 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 to the needs of today’s programmer. Nothing demonstrates this fact better than the release of version 2.0.

C# 2.0 is the first major revision to C#, coming about five years after its initial 1.0 release. The intervening years have seen ever-increasing demands placed on the programmer. Applications have become more complex, and so has the environment in which they execute. C# has responded by adding a list of innovative features that make it easier for programmers to write more resilient, reliable, and nimble code. Here are three examples. Generics make possible the creation of type-safe, reusable code. Partial class declarations facilitate the coding of large classes by allowing their definitions to be broken into pieces. Anonymous methods streamline the coding of methods passed to delegates. In general, C# 2.0 contains many forward thinking features that make programming for today’s demanding environment a bit easier.

This book is a comprehensive guide to the C# language, including those features added by C# 2.0.

What’s Inside

One of the most challenging aspects of writing about C# is knowing when to stop! The C# language, by itself, is big. The C# class library is even bigger. To help manage this large amount of material, the book is divided into these three parts:

  • The C# Language

  • Exploring the C# Library

  • Applying C#

Part I provides a comprehensive discussion of the C# language, including the new features added by version 2.0. This is the largest part in the book, and it describes the keywords, syntax, and features that define the C# language. I/O, file handling, reflection, and the preprocessor are also described in Part I.

Part II explores the C# class library, which is also 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. This is the part of the library that relates most specifically to C#. Also covered are collections, multithreading, and networking. These are the parts of the library that nearly every C# programmer will use.

Part III contains examples that apply C#. Chapter 25 shows how to build software components; Chapter 26 describes the construction of Windows applications using the Windows Forms library; and Chapter 27 develops a recursive-descent parser for numerical expressions.




C# 2.0(c) The Complete Reference
C# 2.0: The Complete Reference (Complete Reference Series)
ISBN: 0072262095
EAN: 2147483647
Year: 2006
Pages: 300

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net