Tuesday, October 6, 2009

Morning Session 2: Getting Started with .NET 4.0 and C# 4.0

Going to sit and learn a bit about what's happening in 4.0. This is supposed to be targeted at mid- to high- level .NET developers and focuses a lot more on the framework, not the IDE. I'll try to keep up.

Get his slides (later) from RichardHaleShawGroup.com/downloads.aspx, access code VSLiveOrlando2009

Morning Session 2: Getting Started with .NET 4.0 and C# 4.0
Richard Hale Shaw
Code with Confidence

Wow, this guy HATES Vista. Finally got done with a long rant about it. [My Note: He wasn't done.]
Not talking about F#, and I probably won't go to that session later.
Advances always around producing problem solving code with fewer lines. [My Note: sometimes at the expense of readabilty. Looking at you, lambda functions]
First change to CLR since 2.5

Can now cast generics better...so List of strings can be cast to List of objects just like string can be cast to object - he describes this as a bug fix. Has not come up for me yet, but can see where it would be useful.
Have not worked with LINQ, but some new capabilities to pull data using parallel processes using a simple AsParallel() method. Added stuff to System.Threading.

Dynamic language programming bundled in. C# not dynamic, but can USE objects built by dynamic languages. Basically, any object declared using dynamic (which is...weirdly...a static type) will not throw any compiler errors no matter what methods you call. They turn into runtime errors). I'm very wary about dynamic languages from a code maintainability standpoint, and I hate turning compile errors into runtime ones. But I think the idea of being able to leverage Ruby and Python libraries that build dynamic objects is a good one. I can just see this being abused to write screwy, unreadable, hard-to-maintain code. End rant.

Optional parameters with default values. Woo hoo!
Named parameters so user can pass parameters in any point...and increase readability.
CalculateBMI(weight:123, height:64);

New Tuple object that lets you put any number of objects together on the fly without building a class.
New thread-safe collection class.
Code Access Security is now obsolete. Recommends now OS-level solutions like Windows Software Restriction Policies. Can/should use Transparency Model from Silverlight.

"The biggest mistake we make is assuming that it's more expensive to take the time to do the rewrite than to live with our old junky code."

Presentation was fine, but VERY rushed. Spun through tons of slides really fast, skipping tons of them. Focused on some interesting stuff, but there was just more data than the time slot allowed.

No comments:

Post a Comment