1 / 12

A brief overview by Jack Senechal and Bryan Powell

C#. A brief overview by Jack Senechal and Bryan Powell. 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. Language Features. Strongly Typed

Download Presentation

A brief overview by Jack Senechal and Bryan Powell

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  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. Language Features • Strongly Typed • Has automatic garbage collection • native support for interfaces and interface inheritance

  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. 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. 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. 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. 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. Scoping • class A • { • int i = 0; • void F() { • i = 1; // Error, use precedes declaration • int i; • i = 2; • } •  } • No scoping operators

  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. Errata • Library support – significant support from Microsoft as part of the .NET framework. • Delegates – C#’s way of dealing with pointers to methods

  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

More Related