Anders Hejlsberg Distinguished Engineer Developer Division Microsoft Corporation
C# – The Big Ideas
The first component oriented language in the C/C++ family Everything really is an object Next generation robust and durable software Preservation of investment
A component oriented language
C# is the first “component oriented” language in the C/C++ family Component concepts are first class:
Properties, methods, events Design-time and run-time attributes Integrated documentation using XML
C# – The Big Ideas
Enables one-stop programming
No header files, IDL, etc. Can be embedded in web pages
Everything really is an object
Traditional views
C++, Java: Primitive types are “magic” and do not interoperate with objects Smalltalk, Lisp: Primitive types are objects, but at great performance cost
C# – The Big Ideas
C# unifies with no performance cost
Deep simplicity throughout system
Improved extensibility and reusability
New primitive types: Decimal, SQL… Collections, etc., work for all types
Robust and durable software
Garbage collection
No memory leaks and stray pointers
C# – The Big Ideas
Exceptions
Error handling is not an afterthought
Type-safety
No uninitialized variables, unsafe casts
Versioning
Pervasive versioning considerations in all aspects of language design
Preservation of Investment
C++ heritage
Namespaces, enums, unsigned types, pointers (in unsafe code), etc. No unnecessary sacrifices
C# – The Big Ideas
Interoperability
What software is increasingly about MS C# implementation talks to XML, SOAP, COM, DLLs, and any .NET language
Millions of lines of C# code in .NET
Short learning curve Increased productivity
Hello World using System; class Hello { static void Main() { Console.WriteLine("Hello world"); } }
C# Program Structure
Namespaces
Contain types and other namespaces
Type declarations
Classes, structs, interfaces, enums, and delegates
Members