CSharp/C# Tutorial - C# Introducing

C# and the .NET Framework

C# is a general-purpose, type-safe, object-oriented programming language.

C# has many features and balances simplicity, expressiveness, and performance.

The C# language is platform-neutral, but works well with the Microsoft .NET Framework.

Object Orientation

C# is an implementation of the object-orientation paradigm, which includes encapsulation, inheritance, and polymorphism.

Unified type system

C# has a unified type system, where all types ultimately share a common base type.

Classes and interfaces

C# can define an interface, class, event, delegate, event, and much more.

In C#, methods are only one kind of function member, which also includes properties and events.

Properties are function members that encapsulate a piece of an object's state, such as a button's color or a label's text, or price of a product.

Events are function members that simplify acting on object state changes.
C# has a formal way to create events.

Type Safety

C# is primarily a type-safe language.

C# supports static typing, meaning that the language enforces type safety at compile time.

C# allows parts of your code to be dynamically typed via the dynamic keyword.

Memory Management

C# relies on the runtime to perform automatic memory management.

The Common Language Runtime(CLR) has a garbage collector that executes as part of your program, reclaiming memory for objects that are no longer referenced.

C# and CLR

C# is typically used for writing code that runs on Windows platforms.

The design of C# closely maps to the design of Microsoft's Common Language Runtime (CLR).

CLR provides these runtime features.

C# type system maps closely to the CLR type system.

The .NET Framework consists of the CLR and a set of libraries.

The CLR is the runtime for executing managed code.