Слайд 2
![C# Presentation, Spring 2003 Introduction C#, pronounced “C Sharp,” is](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-1.jpg)
C# Presentation, Spring 2003
Introduction
C#, pronounced “C Sharp,” is one
of the new languages in the .NET framework being implemented by Microsoft. All .NET languages compile to a common byte code (MSIL) making their integration into programs written in different languages easier.
Слайд 3
![C# Presentation, Spring 2003 History C C++ Developed by Anders](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-2.jpg)
C# Presentation, Spring 2003
History
C
C++
Developed by Anders Hejlsberg
Turbo Pascal
Delphi
Visual J++
Released in 2001-2002
Слайд 4
![C# Presentation, Spring 2003 Previous Problems Memory Leaks Illegal Pointer References Overly Complex Multiple-Inheritance Static Linking](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-3.jpg)
C# Presentation, Spring 2003
Previous Problems
Memory Leaks
Illegal Pointer References
Overly Complex Multiple-Inheritance
Static Linking
Слайд 5
![C# Presentation, Spring 2003 Resolutions Garbage Collection Threw out pointers](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-4.jpg)
C# Presentation, Spring 2003
Resolutions
Garbage Collection
Threw out pointers
Single inheritance with Interfaces
Dynamic Linking
Done
5 years ago in Java
Слайд 6
![C# Presentation, Spring 2003 What is C# Contrary to popular](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-5.jpg)
C# Presentation, Spring 2003
What is C#
Contrary to popular belief, C# is
not simply a clone of or replacement for Java
According to Anders Hejlsberg, Microsoft’s Chief Architect, C# is a derivation of C++, C, Java, Modula 2, and Smalltalk
Слайд 7
![C# Presentation, Spring 2003 What is C# C# combines the](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-6.jpg)
C# Presentation, Spring 2003
What is C#
C# combines the best features of
these languages and eradicates some of their weaknesses
Слайд 8
![C# Presentation, Spring 2003 Why Choose C#? C# was designed](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-7.jpg)
C# Presentation, Spring 2003
Why Choose C#?
C# was designed from scratch with
the .net framework in mind
C# combines the power of C and C++ with the productivity of Visual Basic
With its familiar syntax the transition for Java and C++ programmers will be an easy one
Слайд 9
![C# Presentation, Spring 2003 Why Choose C#? C# is in](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-8.jpg)
C# Presentation, Spring 2003
Why Choose C#?
C# is in sync with
current web standards and is easily integrated with existing applications.
In today’s society where internet programming is inevitable having a language that already supports this makes the job of the developer easier.
Слайд 10
![C# Presentation, Spring 2003 Example of Code The code looks](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-9.jpg)
C# Presentation, Spring 2003
Example of Code
The code looks a lot like
Java
public class Example
{
public static void Main(string[] args)
{
foreach (string s in args)
{
System.Console.WriteLine(s);
}
}
}
Слайд 11
![C# Presentation, Spring 2003 Features OOP](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-10.jpg)
C# Presentation, Spring 2003
Features
OOP
Слайд 12
![C# Presentation, Spring 2003 OOP C# is object oriented. Every](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-11.jpg)
C# Presentation, Spring 2003
OOP
C# is object oriented. Every class is a
subclass of an object. Everything is an object, yes even primitives. This makes generic programming easier.
Example:
int n = 3;
string s = n.ToString();
Слайд 13
![C# Presentation, Spring 2003 Features OOP Enumerators](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-12.jpg)
C# Presentation, Spring 2003
Features
OOP
Enumerators
Слайд 14
![C# Presentation, Spring 2003 Enumerators Enumerators are a borrowed idea](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-13.jpg)
C# Presentation, Spring 2003
Enumerators
Enumerators are a borrowed idea from C/C++. This
is a data type consisting of a set of of named integers.
Example:
enum Weekday {Mon, Tues, Wed, Thu,
Fri, Sat, Sun};
Слайд 15
![C# Presentation, Spring 2003 Features OOP Enumerators Operator Overloading](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-14.jpg)
C# Presentation, Spring 2003
Features
OOP
Enumerators
Operator Overloading
Слайд 16
![C# Presentation, Spring 2003 Operator Overloading Operator Overloading is yet](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-15.jpg)
C# Presentation, Spring 2003
Operator Overloading
Operator Overloading is yet another idea borrowed
from c++. This makes polymorphism easier with custom data types.
Example:
Currency a, b, c;
c = a + b;
Слайд 17
![C# Presentation, Spring 2003 Features OOP Enumerators Operator Overloading Windows API Invocation](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-16.jpg)
C# Presentation, Spring 2003
Features
OOP
Enumerators
Operator Overloading
Windows API Invocation
Слайд 18
![C# Presentation, Spring 2003 Windows API Invocation C# was built](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-17.jpg)
C# Presentation, Spring 2003
Windows API Invocation
C# was built with Windows in
mind. It was created to allow programmers to create Windows application easily through a wraparound API. Some other technologies supported are COM, COM+.
Слайд 19
![C# Presentation, Spring 2003 Features OOP Enumerators Operator Overloading Windows API Invocation Structured Error Handling](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-18.jpg)
C# Presentation, Spring 2003
Features
OOP
Enumerators
Operator Overloading
Windows API Invocation
Structured Error Handling
Слайд 20
![C# Presentation, Spring 2003 Structured Error Handling C# introduces new](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-19.jpg)
C# Presentation, Spring 2003
Structured Error Handling
C# introduces new error handling techniques.
Try-catch blocks are used but with more functionality.
To throw an object, it has to be a subclass of System.Exception.
Слайд 21
![C# Presentation, Spring 2003 Try-Catch try-catch blocks could be any](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-20.jpg)
C# Presentation, Spring 2003
Try-Catch
try-catch blocks could be any of the following;
try{
} catch(SomeException){ }
try{ } catch(){ } //catches any kind of exception
try{ } catch(){ } finally{ } //finally is always executed
try{ } finally{ } //finally is always executed
Слайд 22
![C# Presentation, Spring 2003 Features OOP Enumerators Operator Overloading Windows API Invocation Structured Error Handling Delegates](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-21.jpg)
C# Presentation, Spring 2003
Features
OOP
Enumerators
Operator Overloading
Windows API Invocation
Structured Error Handling
Delegates
Слайд 23
![C# Presentation, Spring 2003 Delegates Delegates provide a template for](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-22.jpg)
C# Presentation, Spring 2003
Delegates
Delegates provide a template for a single method.
Example:
public
delegate int ArithOp(int a, int b);
…
public int DoOp(ArithOp ar)
{ return ar(a, b); }
Слайд 24
![C# Presentation, Spring 2003 Features OOP Enumerators Operator Overloading Windows](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-23.jpg)
C# Presentation, Spring 2003
Features
OOP
Enumerators
Operator Overloading
Windows API Invocation
Structured Error Handling
Delegates
Namespaces
Слайд 25
![C# Presentation, Spring 2003 Namespace Namespace is a method of](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-24.jpg)
C# Presentation, Spring 2003
Namespace
Namespace is a method of organizing similar files
together. This is similar in some way to the java package idea. Every program is either explicitly within a namespace or in by default.
Example:
namespace Project{ public class P1{} }
public class P2{}
Слайд 26
![C# Presentation, Spring 2003 Namespace To use a namespace, you](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-25.jpg)
C# Presentation, Spring 2003
Namespace
To use a namespace, you just simply
import by using the keyword using.
Example:
using system;
public class P1{}
Слайд 27
![C# Presentation, Spring 2003 Future of C# With C#’s flexibility](/_ipx/f_webp&q_80&fit_contain&s_1440x1080/imagesDir/jpg/161749/slide-26.jpg)
C# Presentation, Spring 2003
Future of C#
With C#’s flexibility and support for
many languages through the .NET architecture it will definitely become a widely used language in all aspects of programming.