The first day of Tech Ed has been exciting and full of things to be learned and explored. Here are the sessions I attended and my thoughts/reflections on each.
Keynote with Bill Gates, S. "Soma" Somasegar, others
Pragmatic Architecture: The Role of an Architect with Ted Neward
Best Practices with the Microsoft Visual C# 3.0 Language Features with Mads Torgersen (PM for C#)
Automatically implemented properties
public string CustomerID { get; set; }
Implicitly typed Local variables
var custs = new List<Customer>()
{
new Customer()
CustomerID = “MADST”;
CustomerName = “Mads Torgersen”;
City = “Redmond”;
}
Collection and Object Initializers
Code-result Isomorphism
Shape imitates result
ObjectDumper
Extension Methods
Public static IEnumerable<Customer> GetLondoners(this IEnumerable<Customer> source)
Foreach (var c in source)
If (c.City == “London”) yield return c;
}Allows you to insert extension methods into an instance (even if static)
New functionality on existing types
Scoped by using causes
Interfaces & constructed types
Lambda Expressions
Public static IEnumerable<T> Filter <T>(GetLondoners(this IEnumerable<T> source, Predicate>T> p)
foreach (var c in source)
If (p(c)) yield return c;
var query customers.Filter(delegate(Customer c) { return c.City == “London”; };
Terse syntax for anonymous methods:
var query customers.Filter(c =>{ c.City == “London”;});
*When you only have one thing left you can remove the parens
LINQ to Objects
var query = Customers
.Where( c=> c.City == “London”);
.Select ( c=> c.ContactName);
ObjectDumper.Write(query);
Monads – Look into this
Don’t use LINQ for *other magic* that is not a query
Expression Trees
Related to link
Expression(of)
Represents a lambda expression as an expression tree at runtime
ASP.NET MVC with Scott Hanselman
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.