Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
C# ПІДРУЧНИКИ / c# / Manning - Windows.forms.programming.with.c#.pdf
Скачиваний:
108
Добавлен:
12.02.2016
Размер:
14.98 Mб
Скачать

of the Internet, and the redesign of the DOS-based Windows into Windows NT and Windows XP.

CASTING THE .NET

Against this backdrop of technologies and products, the Internet has been redefining the way we as programmers think about user interfaces and application development. With the success of the Internet and companies such as Netscape and Amazon.com, a product or interface may now appear in a web browser rather than a more traditional Windows application. The Java programming language has had much success in UNIX and web server environments, and is the language of choice for many largescale web applications at present.

Perhaps in response to these changes, or perhaps because it became clear that the line between a user’s desktop and the Internet was starting to blur, Microsoft set out to revolutionize the way we think about and develop applications. The result of their work is the .NET Framework and the C# programming language.2

The easiest way to understand C# might be to imagine someone writing down all the annoying aspects of C++ and then designing a language to do away with each item on this list. In C++, for example, dealing with pointers can be painful; a number of coding errors are not caught by the compiler (such as if (x = 5)); manipulating strings can be difficult; and there is no good way to safely “downcast” an object to a derived type. The predecessors of C and C++, the B and BPCL languages, did not define a formal type system, which may well account for the free-wheeling nature of integers, pointers, and characters in these languages.

The C# language was redesigned from the ground up with the idea of retaining the flexibility of C and C++ while formalizing the type system and language syntax. Many common runtime errors in C++ are compiler errors in C#. Other distinct features include a built-in string type, lack of global variables, and integration of critical system and application errors into a common exception model. Appendix A of this book provides an overview of the syntax, keywords, and features of the C# language.

While not strictly required from a design perspective, the C# language and .NET Framework will likely remain tightly intertwined for some time. The .NET Framework is a programming interface and execution environment for Windows operating systems, and large parts of the framework itself were written in C#.

The .NET Framework includes almost all of Microsoft’s development technologies and environments that have evolved over time, from COM to XML and ASP to Visual Studio. These technologies are recreated and reinvented under a single umbrella. While backward compatibility has not been totally lost, the .NET Framework redefines the classes and methods for these technologies and the products that use them. In particular,

2 The Visual Basic language was also redesigned, and numerous Microsoft products have been affected. Visit the site www.microsoft.com/net for detailed information about the history and scope of .NET.

CASTING THE .NET

xxix

Соседние файлы в папке c#