T40T, 6th June 2008 to 9th June 2008

Csharp kitteh

(kitteh codez: ./;;;;;;;;;;;;;;;;;;;;)

Time to start C# familiarisation, this long weekend is the weekend to start. My guide is the book: “Pro C# 2008 and the .Net 3.5 Platform” written by Andrew Troelson

Having last been semi-professional in Java about 10 years ago, there are many similarities. But lots of new platform learnings. Unix shell, paths and commands are difficult things to dump.

Just ensuring I understand the fundamentals before I jump into the deep end of the BCL and other .Net goodness

So, some new things:

  • using the Visual Studio Command Prompt to pre-setup paths
  • @*.rsp files for input to csc.exe (to replace command lines)
  • Console.* and Environment.* for command-line/console style apps; along with return values
  • Escape characters vs. @”sss” verbatim strings
  • Narrowing/Widening datatypes at compile time (short/ints)
  • out, ref, params (leave params as last argument)
  • operator overloading (sans generics), arrays, simple objects, enums’
  • structs on the stack, vs referenced types on heap
  • Nullable types (using ? at the end of the type declaration, ?? as default override if value is null)
  • Objects, default constructors
  • constructor chaining using this. keyword
  • Encapsulation using properties (auto getters and setters, or Accessors and Mutators)
  • partials (one class across multiple *.cs files)
  • class diagrams; same 3 base things of OO programming (encapsulation, inheritance and polymorphism)
  • base class construction
  • nested classes
  • virtual, override in polymorphism; as keyword + null test in polymorphism
  • SEH. Structured exception handling
  • The heap, generations as a method of marking objects as “more likely to stick around” in System.GC
  • Finalize. Finalize when unmanaged (ie: Pinvoke) objects
  • Dispose. call Dispose on an object that implements IDisposable (if x is IDisposable…)

Inspecting ur classes

New feature of Visual Studio 2008, LOLCAT edition. CATROSPECSHUN OV UR CLASSEZ