New Zealand's new Copyright Law presumes 'Guilt Upon Accusation' and will Cut Off Internet Connections without a trial. CreativeFreedom.org.nz is against this unjust law - help us


A Space for All Things .NET Related


.NET User Group meeting 4 Jul 2007

By James Hippolite, in , posted: 6-Jul-2007 07:58

What’s new in VB9

  • Philip Cox
  • Senior Developer
  • Trade Me Ltd

www.ribboncustomizer.com

  • RCWOUG1
  • 15% discount until 19 July

Brief history

  • 1991 – Microsoft VB1 for Windows
  • 1998 – VB6
    • Easy to learn and use
    • Quick to create Windows GUI applications
    • Get’s picked on by lower level languages
  • 2002 – VB7
    • .Net 1.0
    • Garbage collection, structured error handling…
    • All the tools of the.net framework
    • Get’s picked on by C#
  • 2003 – VB 7.1
  • 2005 – VB 8
    • Edit and Continue
    • The My namespace
    • Generics
    • And more…

Implicitly Typed Local Variables

  • E.g “Dim memberId = 31719”
  • A switchable option

Object Initializers

  • Set properties of an object at the time of instantiating the object
  • Uses WITH

Collection Initializers

  • Dim x = {2, 4 ,5, 7}

Extension Methods

  • <Extension()> Function name(value as objectType) as outputType… End Function
  • Extends the object type (e.g. string)

Lambda Expressions

  • Not in Orcas Beta1 for VB
  • Is there for C#
  • Pointers to functions

Anonymous Methods (C#2.0)

  • The old way of doing Lambda Expressions
  • Take an object and return a function of that object
  • E.g. CalcLength lengthFunction = t => t.Length;
  • Console.WriteLine(“{0}”, lengthFunction(“Hi!”));

Anonymous Types

  • Var anon = new { firstName=”Phil”, LastName=”Cox”};
  • Dim anonymousType = New With (.FirstName=”Phil”, .LastName=”Cox”}

Deep XML Support

  • (C# does have)
  • Dim xml = _
    • <?xml versoin =”1.0”?>
    • <CoolNewFeatures name=”Nullabletype”>
  • Not in Orcas Beta1

LINQ (Language Integrated Query)

  • LINQ To Objects
  • LINQ Enabled ADO.net
    • LINQ To datasets
    • LINQ To SQL
    • LINQ To entities
  • LINQ to XML
    • FROM first (for IntelliSense)
    • WHERE <% entity.attribute %>
    • SELECT <xml>
  • LINQ to Objects too

Nullable Types

  • Not in Orcas Beta1 for VB
  • Int? nullableInt;
  • If(nullableInt == null) {}
  • Int I =

Relaxed Delegates

  • (only in VB)
  • AddHandler button1.Click, AddressOf clickEvent
  • Private Sub ClickEvent()                ‘No need to specify arguments

Partial Methods

  • Not in Orcas Beta1 for VB
  • Can redefine methods in same class
  • Must be sub (or void) because sometimes it will return a value and other times it won’t
  • Can only be one stub and one implementation
  • If more than one implementation, compile error

Automatic Properties

  • Not in VB at all
  • Public class Person {
  • Public string FirstName {get; set;}
  • Public string LastName { get; set; }
  • Public int Age (get; set; }
  • }

And more!

  • Turnery “If”
  • Coalesce operator
  • Improved IntelliSense
  • “My” extensions
  • And more…

What’s new in C# 3.0

  • Kirk Jackson
  • Senior Developer
  • Xero

Agenda

  • A brief history
  • What’s new
  • Questions

Brief history

  • Pre 2000 – Other programming languages ruled the world
  • June 2000 – C# Announced at PDC
    • Beta version released
    • No comparisons to Java are made
    • ECMA Standardisation
  • 2001 – Mono C#
  • 2002 – Wellington .NET User Group
  • 2003 – VS .NET 2003
  • 2005 – VS .Net 2005
  • 2006 - .NET Framework 3.0
  • 2008 – C#3.0

Questions

  • Is it time to switch back to VB?  That XML stuff looks pretty good.
  • Personally can’t see any difference/reason to change
  • Do C# developers get paid more? 
    • There is prejudice against VB
    • However, there is a shortage of VB
    • Perhaps C# developers come from a Comp Sci (academic) background
    • Perhaps VB developers come from a Comm (business) background
    • Perhaps managers get paid more?


Tag(s):     


Other related posts:
Delivered my Quality Presentation Again
The Microsoft Sync Framework
What's New in Microsoft SQL Services - My DNUG Presentation






Add a comment

Please note: comments that are inappropriate or promotional in nature will be deleted. E-mail addresses are not displayed, but you must enter a valid e-mail address to confirm your comments.

Are you a registered Geekzone user? Login to have the fields below automatically filled in for you and to enable links in comments. If you have (or qualify to have) a Geekzone Blog then your comment will be automatically confirmed and shown in this blog post.

Your name:

Your e-mail:

Your webpage:

JamesHip's profile

James Hippolite
Wellington
New Zealand


Welcome to my technical blog. 

Here, I attempt to distill the Microsoft Certified Professional Developer knowledge I have accumulated since first qualifying MCP in 1996.  This blog started on 13 September 2007 as an off-shoot from my mixed up personal blog.  But it took a shot in the arm from Scott Hanselman's talk at TechEd New Zealand 08 "32 Ways To Make Your Blog Suck Less".