Intro To C#

1,608 views
1,518 views

Published on

.NET alpha nerd Jeff's presentation: a programmers' introduction to C# and .NET.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,608
On SlideShare
0
From Embeds
0
Number of Embeds
46
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Intro To C#

  1. 1. Intro to C# and .NET  Jeff Klawiter  Senior Developer at  MCPD ASP.NET 2.0, MCTS: WinForms 2.0  http://www.jeffklawiter.com  http://nerdery.com/people/jk
  2. 2. C# History  ECMA 335  Need for a strong C based language for .NET  Borrows more syntax from Java and C than C++  Static Typed  Current Version 3.0
  3. 3. .NET Overview  Standardized as ECMA 334  Managed memory  Common Type System  Languages may expose types differently  Common Language Runtime  Multiplelanguages can run together  Common Intermediate Language used as the base language  Currently 20+ languages (including PHP)
  4. 4. .NET Platforms  Desktop  SQL Server  Windows Forms  Windows Services  WPF: Windows  Console Applications Presentation Foundation  Shell Scripting with  Mobile: Compact Powershell Framework  Micro Framework  ASP.NET  Embedded development  Web Forms and MVC for sensors, embedded  Silverlight LCD touch screens, home automation  XNA  2D and 3D video games  COM objects  Surface  Office Plugins  Specialized WPF with  WCF multi touch  Multi Protocol Web Services  HTTP, TCP, REST, SOAP…
  5. 5. Variable Types  All types inherit from System.Object  Reference and Value Types  Reference Types represent a pointer to an object in memory  Passed by reference  Fully mutable  Value Types represent primitive types  Passed by value  int, string, double  Inherits from System.ValueType
  6. 6. Data Types byte decimal sbyte IntPtr No built-in type. short UIntPtr No built-in type. int object long string ushort uint ulong float double bool char
  7. 7. Collections  Arrays  Fixed Size  Inherits from System.Array  int[] myArray = new int[] {1, 3, 5, 7, 9};  Generics Lists  Strongly typed  Expanding Size  Inheritible  List<Person> people = new List<Person>();  people.Add(new Person(){ FirstName = “Jeff”,..});
  8. 8. Operators Operator category Operators Arithmetic + - * / % Logical (boolean and bitwise) & | ^ ! ~ && || true false String concatenation + Increment, decrement ++ -- Shift << >> Relational == != < > <= >= Assignment = += - = *= /= %= &= |= ^= <<= >>= Member access . Indexing [] Cast () Conditional ?: Delegate concatenation and removal + - Object creation new Type information as is sizeof typeof
  9. 9. Advanced Features  Delegates  Referencable functions  Lambdas (x=>x.Name.StartsWith(“m”))  Anonymous Functions  inline delegates  Extension Methods  Add functions to class instance  Partial Classes  Split classes across multiple files  Partial Methods  Lightweight Events between partial class files.  Useful with tool generated code  LINQ: Language Integrated Query  var result = list.Where(x=>x.Name.StartsWith(“m”))
  10. 10. Demos
  11. 11. References  Visual C# 2008: The Language  Best C# book out there  Covers from novice to professional and beyond  Also covers visual studio  MonoDevelop  http://monodevelop.com/  Native C# development on Mac OS X and Linux  Visual C# Express 2008 (Free Visual Studio)  http://www.microsoft.com/Express/

×