Introduction to the C# Language and the .NET Framework
INTRODUCTION TO C#
- C# is a multi-paradigm programming language which is based on objectoriented and component-oriented programming disciplines.
- It provides a framework for free intermixing constructs from different paradigms. 0 It uses the “best tool for the job” since no one paradigm solves all problems in the most efficient way.
DESIGN GOALS
- C# was intended to be a simple, modern, object-oriented language.
- The language and implementation had to provide support for software engineering principles like strong type checking, array bounds checking and automatic garbage collection.
- The language was intended for development of software components suitable for deployment in distributed environments.
- Source code portability was important for programmers who were familiar with C and C++.
- Support for internalization to adapt the software to different languages.
WHY C# ? : FEATURES
- C# is the first “component-oriented” language in the C/C++ family.
- The big idea of C# is that everything is an object.
- C# is a programming language that directly reflects the underlying Common Language Infrastructure (CLI). Most of its intrinsic types correspond to value-types implemented by the CLI framework.
- Type-safety: C# is more type safe than C++. Type safety is the extent to which a programming language discourages or prevents type errors.
- C#, like C++, but unlike Java, supports operator overloading.
- Managed memory is automatically garbage collected. Garbage collection addresses the problem of memory leaks by freeing the programmer of responsibility for releasing memory that is no longer needed.
- C# provides properties as syntactic sugar for a common pattern in which a pair of methods, accessor (getter) and mutator (setter) encapsulate operations on a single attribute of a class.
INTRODUCTION TO .NET FRAMEWORK
- .NET framework is a software framework primarily for Microsoft Windows. It includes a large library & provides language interoperability across several programming languages.
- Programs written for the .NET Framework execute in a software environment, as opposed to a hardware one for most other programs. Common examples of such programs include Visual Studio, Team Explorer UI, Sharp Develop .
- Programmers combine their own source code with the .NET Framework and other libraries. The .NET Framework is intended to be used by most new applications created for the Windows platform.
DESIGN FEATURES
- Interoperability: .NET Framework provides means to access functionality implemented in newer and older programs that execute outside the .NET environment. Access to COM components is provided in the System.Runtime.InteropServices and System.EnterpriseServices namespaces of the framework.
- Common Language Runtime engine: CLR serves as the execution engine of the .NET Framework. All .NET programs execute under the supervision of the CLR, guaranteeing certain properties and behaviors in the areas of memory management, security, and exception handling.
- Language Independence: .NET Framework introduces Common Type System which define all possible data types & programming constructs supported by CLR & ruled for their interaction as per CLI specification. This allows the exchange of types & object instances between libraries & their applications written using any conforming .NET language. DESIGN FEATURES …cont.
- BCL: It is a library of functionality which is available to all languages using the Framework. It consists of classes, interfaces or reusable types that integrate with CLR.
- Portability: The framework allows platform-agnostic & cross-platform implementations for other OS’. The availability of specifications for the CLI, & C# make it possible for third parties to create compatible implementations of the framework & it’s languages on other platforms.