Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 C# A brief overview by Jack Senechal and Bryan Powell.

Similar presentations


Presentation on theme: "1 C# A brief overview by Jack Senechal and Bryan Powell."— Presentation transcript:

1 1 C# A brief overview by Jack Senechal and Bryan Powell

2 2 Origins Developed in the late 90’s by Anders Hejlsberg at Microsoft, as part of MS’s.NET strategy Similar to Java Descended from C and C++ Modern, Object Oriented language

3 3 Language Features Strongly Typed Has automatic garbage collection native support for interfaces and interface inheritance

4 4 Target audience All around language, covering more of the spectrum of possible applications than Java. Meant to be a balance between control and productivity.

5 5 Cross-Platform Compatibility Microsoft designed C# with cross-platform compatibility in mind. Any platform with the.NET framework implemented (i.e., Windows) can run programs written in C# and compiled to MSIL. However, other compilers are becoming available (MCS, the Ximian C# compiler, compiles C# code to CIL, an intermediate language that can be run using their JIT compiler on a multitude of platforms).

6 6 Language Translation “The Common Language Runtime (CLR) manages the execution of.NET code. When you compile a C# program, the output of the compiler is not executable code. Instead, it is a file that contains a special type of pseudocode called Microsoft Intermediate Language (MSIL).... The JIT compiler converts MSIL into native code on a demand basis as each part of your program is needed.”

7 7 Flow Control Conditional Statements · ternary operator ([ test ] ? statement_1 : statement_2;) · if statement · if-else statement · switch statement Looping Statements · for · while · do-while Jump Statements · goto statement · break statement · continue statement · return statement

8 8 Parameter Passing 4 types of parameter passing: value (default – pass by value) ref (pass by reference) out (the caller passes only the address of the object, which the callee must instantiate with some new value—the old value of the object is discarded and ignored, and it is illegal to try and reference it within the callee) params (collects parameters from the caller and creates a local array of these elements— the number of parameters need not be specified).

9 9 Scoping class A { int i = 0; void F() { i = 1; // Error, use precedes declaration int i; i = 2; } No scoping operators

10 10 Interesting Datatypes Uses both [][] and [,] notations for multi- dimensional arrays. The [][] is called a jagged array, and is considered an array of arrays, whereas [,] is simply a single two-dimensional array. Still not sure what the difference is functionally, if any. Decimal – 28-29 decimal places of accuracy.

11 11 Errata Library support – significant support from Microsoft as part of the.NET framework. Delegates – C#’s way of dealing with pointers to methods

12 12 Resources http://www.c-sharpcorner.com/ http://msdn.microsoft.com/vstudio/techinfo/articles/upgrade/Csharpintro.asp http://msdn.microsoft.com/vcsharp/ http://www.csharphelp.com/ http://genamics.com/developer/csharp_comparative.htm http://www.csharp-station.com/Tutorial.aspx http://www.microsoft.com/mspress/books/sampchap/5490.asp http://www.cs.unca.edu/~powellba/example.cs http://www.cs.unca.edu/~powellba/example.exe


Download ppt "1 C# A brief overview by Jack Senechal and Bryan Powell."

Similar presentations


Ads by Google