Introduction to C# .NET
and the .NET Platform
In this chapter, you will
• Learn about the .NET Framework
• Become familiar with the .NET languages
• Discover the environment surrounding C# .NET
• Compile your first C# program
• Learn the basics of the C# language
• Be introduced to object-oriented programming
• Learn to use abstraction and encapsulation
• Learn to differentiate between instance data and class data If you have been around the programming world for a while, you may have some experience with languages such as Visual Basic, C++, or Java. These languages commonly provide desktop solutions, and over the years have had to expand their reach to include “enterprise” development. In order to accommodate the concepts of distributed programming, reusable software, and platform independence, languages were extended and programming structures were put into place. These additions include such things as Component Object Model (COM), Distributed Component Object Model (DCOM), Transaction servers and Application servers. Microsoft was quick to notice that a shift in development practices began with the introduction of Internet programming. The Internet necessitated some kind of common interface to be placed in front of the user. The software languages were struggling to provide scripted or interpreted environments that could run in a browser on every kind of platform. If you have ever had to work with plug-ins, browser incompatibility, slow scripted languages, or out-of-date runtime environments, you will understand the difficulties that developers faced over the past five years.
You will also appreciate the excitement over Microsoft’s latest offering to the world— the .NET platform. This platform means different things to different people. For the world of network administrators, it means new service applications, such as Microsoft Exchange 2000 Server, Microsoft SQL 2000 Server, and the soon-to-be-released Microsoft .NET Servers.
For the development world, it means delivery of the long-awaited Visual Studio .NET and its arsenal of new and old languages, as well as the Common Language Runtime (CLR). This chapter will introduce you to the .NET platform and explore the fundamentals of the Visual C# programming language, as well as the introductory concepts of object- oriented programming (OOP). Please keep in mind that if you are an experienced OOP programmer, you may just need to skim this chapter for differences between C# and other languages, such as C++ and Java, or you may want to review the chapter as a refresher. Whatever route you choose, there is little or nothing in this chapter that will be directly tested on the Microsoft exams. However, having said that, Microsoft assumes a working knowledge of all the concepts covered in this chapter. If you are new to OOP, you may want to spend extra time in this chapter and work outside the book a little in order to bring your skills to the level required. This book assumes that you already have an excellent grasp of the concepts that are briefly looked at in this chapter. Overview of .NET
Before one can start talking about the C# language, it is imperative to understand the platform upon which it works. Historically, programming using Microsoft development tools has involved the traditional Windows API, a programming interface that sits between coders and the desktop. Microsoft realized that as software progressed, APIs became complicated and corrupted by a series of updates and changes. Instead of continuing to improve upon it, Microsoft chose to completely revamp the process. .NET introduced a brand-new development platform, called the .NET Framework, which brings together many old, familiar languages, and, of course, includes a new and exciting language, Microsoft C# .NET.
So, What Is .NET?
.NET is huge. Microsoft has invested a great portion of its budget to researching and developing this brand-new way of doing things. It’s not just an offering to the...
Please join StudyMode to read the full document