130 likes | 258 Views
New Features in C# 4.0. Revealing the CLR 4.0 Internals. Svetlin Nakov. Telerik Corporation. www.telerik.com. Table of Contents. What is CLR? What is C#? What is new in CLR 4.0? How CLR 4.0 Works? Garbage Collector Improvements and the Future of Garbage Collecting Functional Programming
E N D
New Features in C# 4.0 Revealing the CLR 4.0 Internals Svetlin Nakov Telerik Corporation www.telerik.com
Table of Contents • What is CLR? • What is C#? • What is new in CLR 4.0? • How CLR 4.0 Works? • Garbage Collector Improvements and the Future of Garbage Collecting • Functional Programming • What is new in C# 4.0? • Comparing C# 4.0 to C# 3.5
A Look Inside CLR What is CLR and How it Works?
What is CLR? • Common Language Runtime • The heart of the .NET Framework • A kind of “Virtual Machine” • Executes the MSIL code • Multiplatform • Runs on Windows (MS .NET Framework) and on Linux (Mono) • Compile-on-demand • Just-in-time compiler (JIT compiler)
Hello World – Example • This is a classical “Hello World example in C#”: using System; using System.Collections.Generic; using System.Linq; namespace TestProject { class Program { static void Main() { Console.WriteLine("Alabala"); } } }
C# Code – How It Works? Define a class called "HelloCSharp" Include the standard namespace "System" Define the Main() method – the program entry point using System; class HelloCSharp { static void Main() { Console.WriteLine("Hello, C#"); } } Print a text on the console by calling the method "WriteLine" of the class "Console"
Inside C# Language How C# Works and How it is Related to CLR
What is C#? • C# is high-level programming language • Similar to Java and C++ • Developed by Anders Hejlsberg, the author of Borland Delphi • Strongly typed • One of the CLR languages • C# is object-oriented language • Programs are made of classes and objects • One on the classes contains the Main() method
New Features in C# 4.0 ? ? Questions? ? ? ? ? ? ? ? ? ?