Tuesday, June 17, 2008

Beginning C# 3.5

I've started C# 3.5 recently and decided to share it with you as long as i can.most of information in these posts will be from "Apress C# 2008 and .Net 3.5", I will suppose that you are familliar with programming and new to .Net 3.5.lets start with some words about the three key components of .Net : CLR, CTS, and CLS

Professional C# (Wrox Press) describe the CLR as:
Central to the .NET Framework is its runtime execution environment, known as the Common Language Runtime (CLR) or the .NET runtime. Code running under the control of the CLR is often termed managed code.

The CLR also takes care of a number of low-level details such as memory management; creating application domains, threads, and object context boundaries; and performing various security checks.

CTS or Common Type System describes data types and programming constructs supported by the runtime there is a related feature named Common Language Specification (CLS) that defines a subset of common types and programming constructs that all .NET programming languages can agree on

besides of this .Net included a base class library that provided a very usefull featues and services like threading or I/O operations

(image from the book)

anoher point that you should notice is .Net executables are not ready to use in target machine(that is why you need to have .Net Framework on target machine unlike unmanaged programs) , C# compiler do not produce final machine code but an intermediate code (like java bitecodes) - ragardless of source code's used language - called IL or MSIL, CLR makes final decisions about what and how our code will acts depending to program and target machine enviroment(that means more optimized code becauese CLR knows target CPU and generates more friendly machine codes)