Tuesday, June 05, 2007

Tech Ed Day 2 - Dead Phones, Dehydration, and LINQ

Day 2 kicked off with a rapid introduction to The .NET Language Integrated Query (LINQ) Framework. This first served as an introduction to C# 3.0 and covered many of the new features which are due in the next release.

Are you fed up with having to expose your private/protected class variables behind public properties? Are your get and set methods so simple that they only return or set a private/protected variable? Wouldn't it be great if the language could help you out so you don't have to type so much code?

C# 3.0 allows you to just provide the outline of the properties, and the compiler will fill in the blanks for you.

Do you hate having to type something like:

ReallyLongClassName myClass = new ReallyLongClassName();

Shouldn't the compiler know that you'll probably want myClass to be of type ReallyLongClassName?

C# 3.0 introduces the "var" keyword that does just this. You type less, but myClass is still strongly typed properly.

C# 2.0 introduced anonymous methods, which allows you to put method code inline instead of having to declare a full delegate elsewhere. C# 3.0 expands on this with Lambda functions which will result in even less code having to be typed. I'm not entirely sure how these work yet, but I certainly mean to look into them in future.

So they're some new features coming in the C# 3.0 language, but the session was about LINQ, not C#.

LINQ is a declarative programming model, where you don't code in how you want to do something, you rather tell it what you want. The example given was iterating through a collection, performing some logic on each item, and then adding that item to a collection. Something that is quite common for most systems.

Instead of setting up a loop, comparing values, instantiating another collection, adding to it, and then returning it, LINQ allows you to just say "From this collection, where this is true, select this given object and return them all".

There's just too much to go into detail with here, so I'll just leave this as a reminder for me to look this up more in the future. But as LINQ works with object collections, relational databases and XML it will totally change how we use collections in code. Also, as we're declaring what we want rather than how to do it, the framework can optimise this to run across the new multi-core processors. It would be very difficult to do this manually, but it's something you can get for free with LINQ.

Next up was a session on best practises for Team Based Development, which I personally found rather disappointing. It seemed to be aimed squarely at large teams with huge budgets, and wasn't particularly relevant to the smaller teams that I'm used to.

A large portion of the session concentrated on communication between the various roles within the team, like developers, testers, architects, etc. Esendex doesn't split roles in this way, and all developers work out of the same office, with no walls between us, so there's no problem with communication.

This concentration on the larger teams certainly doesn't seem to promote agility in development. How can teams react to change if they're working towards deadlines that are months in the future?

The final session for today was a discussion on code standards and styles, but again this didn't seem to tell me anything I don't already know. I knew the session wasn't going to help when some of the attendees began discussing whether or not using correct spelling should be important in code. I agree with the one guy who made the comment along the lines of "if you can understand what's going on, why does it matter?".

Unfortunately that was all I was able to attend today. This morning I noticed that my mobile phone's battery was running low, but my UK charger wouldn't work through the adapter I have. I needed to buy a US charger, so I headed off to Florida Mall, billed as the largest in Orlando, or was it Florida, I can't remember.

Well it wasn't particularly large. Mostly it's all on one floor and there didn't seem to much variety to the shops. There's one bookshop in there, while you can't walk for 2 seconds without passing another shoe or clothes shop. So not really much use for me. I did, however, find a Radioshack that stocked Nokia chargers, so I attempted to head back to the hotel.

I had got a taxi from the hotel to the mall (after taking a shuttle bus from the Convention Center to my hotel to drop my laptop off), and just assumed I would be able to get back the same way. Well, I waited with a number of others near the taxi sign for what must have been 15-20 minutes for no taxis to turn up. So I though I'd have better luck hailing a cab on the road, so headed that way.

Again no cabs, so I started walking in the direction of the hotel keeping an aye out for taxis, but none came. It was a pretty stupid thing to do in hindsight, but I carried on walking anyway. Then I got lost, and ended up on the wrong road so I had to head back. TV weather this morning said the temperature at around that time would have been around 91 degrees, and I was in no shade and had no water.

Like I said, stupid in hindsight. The heat was pretty unbearable, but I saw no other way of getting back at the time. Luckily I soon found a Walmart where I could buy a drink, and from there a nice lady in Customer Services called me a cab that arrived a few minutes later.

By the time I got back it was 8pm and I was in no mood to head back to the Convention Center for the later breakout sessions. So I'll take up where I left off tomorrow, and try not to do anything stupid anymore.

No comments: