DekGenius.com
[ Team LiB ] Previous Section Next Section

Preface

C# is a language targeted at developers for the Microsoft .NET platform who have already worked with a C-like language such as C, C++, or Java. Unlike previous versions of C or C++ for the Microsoft Windows platform, C# code runs under a managed execution environment. While C and C++ developers using Visual Studio .NET can now write managed code using the Managed Extensions for C++, C# offers a middle path between C++'s overall power but sometimes difficult code and the higher-level task orientation provided by Visual Basic .NET. Microsoft portrays C# as a modern and innovative language for .NET development that will be familiar to current C++ programmers while allowing more runtime control over the executing code.

C# allows you to perform many C/C++-like functions such as direct memory access via pointers and operator overloading that are not supported in Visual Basic .NET. Many of the interesting enhancements for .NET languages are slated to appear first in C#, such as generics. (You can think of generics as templates with a twist.) C# is the system-level programming language for .NET. You can still do great application-level work in C#, but it really shines when you need to build code a little closer to the framework.

If you have seen C#, you may have noticed that it looks a lot like Java; Java programmers will feel very much at home in C# once they learn the Framework SDK. C# can also be a great language for Visual Basic .NET programmers when they need a little more control over what the code is doing and don't want to have to write C++ to gain an advantage. There is a large community on the Web of people doing really neat things with C# and there is tons of sample code on sites such as http://www.gotdotnet.com, http://www.codeproject.com, and http://www.4guysfromrolla.com.

We put this book together based on programming problems we ran into when first learning C# as well as during our continued use of it. We hope that it will help you get past some of the common (and not-so-common) pitfalls and initial questions everyone has when learning a new language. There are recipes dealing with things we found missing from the .NET Framework Class Library (FCL), even though Microsoft has provided tons of functionality to keep folks from reinventing the wheel. Some of these solutions you might immediately use and some may never darken your door, but we hope this book helps you get the most out of C# and the .NET Framework.

The book is laid out with respect to the types of problems you will solve as you progress through your life as a C# programmer. These solutions are called recipes; each recipe consists of a single problem, its solution, a discussion of the solution and other relevant related information, and finally where you can look for more information about the classes used from the FCL, other books addressing this topic, related articles, and other recipes. The question-answer format provides complete solutions to problems, making the book easy to read and use. Nearly every recipe contains a complete, documented code sample showing you how to solve the specific problem, as well as a discussion of how the underlying technology works and a list of alternatives, limitations, and other considerations, when appropriate.

    [ Team LiB ] Previous Section Next Section