CSE459_CSharp_02_LanguageOverview

CSE459_CSharp_02_LanguageOverview - Programming in C#...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming in C# Language Overview Language Overview CSE 459.24 Prof. Roger Crawfis
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Overview Quickly go through some of the major differences between C++ or Java and C#. Overview of a C# program. Built-in C# types. Canonical Hello World program
Background image of page 2
My View on C# I have been using C# in our research for since C# 1.0 in 2004. I think it is a great language!!! However, programming languages are a dime a dozen and somewhat insignificant to large-scale programming. The .NET libraries are the real time savers. Or stated differently – well tested, well maintained and well documented reusable components. I could do everything in C, but view C# as an automatic code- generator for many recurring design and programming patterns. A strongly-typed language prevents many simple typos from being bugs.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Language Namespaces Classes Fields Properties Methods Attributes Events Interfaces (contracts) Methods Properties Events Control Statements if, else, while, for, switch foreach Additional Features Operation Overloading Structs Enums Delegates OO Features Type Unification Inheritance Polymorphism
Background image of page 4
C# Program Structure Namespaces Contain types and other namespaces Type declarations Classes, struct’s, interfaces, enum’s, and delegates Contain members Members Constants, fields, methods, operators, constructors, destructors Properties, indexers, events Organization No header files, types imported using assemblies (dll’s). Type reflection
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Major Language Differences Automatic memory management Garbage Collection No pointers Everything inherits from System.Object Additional language constructs to aid in implementing common patterns: Iterators – foreach and yield statements Data encapsulation – Properties Function pointers or Functors – delegates
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 26

CSE459_CSharp_02_LanguageOverview - Programming in C#...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online