Anonymous Types

Well, Connecticut had a small ice storm last night, and I’m one of the lucky ones who still has power.  So, let’s get to work looking at anonymous types in .NET.


(more…)

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Monday, December 3rd, 2007

The Ternary Operator in VB.NET

I think this may be the last operator that I really miss in VB from my curly brace language experience.  Although, I have to admit, I wouldn’t have missed it all that much if they never added it.  There just isn’t a whole lot of use for it.

However, the Ternary operator is a REALLY nice feature to have available to you when you do need it.  It’s another one of those language features that falls under, “Just because it is there doesn’t mean you have to use it.”

If you’ve ever run into a situation where you just need a simple evaluation and assign a variable based on it.  Like this: (more…)

Thursday, November 29th, 2007

Object Initialization in CSharp 3.0 and VB.NET 9

Yesterday we looked at the new var keyword in CSharp.  This makes CSharp variable declaration similar to VB.  After all, they’ve had the DIM keyword for years which essentially does the same thing.

Today, we’re going to look at object initializers, which have been added to both CSharp and VB.

(more…)

Wednesday, November 28th, 2007