# Thursday, May 27, 2010

Tonight, I attended the Cloud Camp Detroit, which was built primarily around Open Spaces discussion and a panel discussion in front of an audience. The basics of cloud computing, specific cloud implementations and issues such as security were discussed. The "eyes-front" presentations were limited to half a dozen lightning talks.

I had a chance to interact with a lot of people far more experienced than me in this area. Many of them work outside the .Net world, so talking with them helps me see the software industry in a different perspective.

I filled in for a sick friend to deliver a presentation on Windows Azure. Below are the slides from my presentation. Thanks to Abe Pachikara of Microsoft for supplying the slides.

Thursday, May 27, 2010 5:04:45 AM (GMT Daylight Time, UTC+01:00)
# Wednesday, May 26, 2010

Episode 90

BizSpark and WebsiteSpark are low-cost software options that Microsoft offers to startup companies. In this interview, Microsoft Partner Evangelist John McClelland describes these programs.

Wednesday, May 26, 2010 12:59:54 PM (GMT Daylight Time, UTC+01:00)
# Tuesday, May 25, 2010

This is a 5-part recording of Chris Marinos's excellent presentation F# and Functional Programming for C# Developers, delivered at the May 19 meeting of the Great Lakes Area .Net User Group (GANG)

Part 1

Part 2

Part 3

Part 4

Part 5

Community | F# | Video
Tuesday, May 25, 2010 11:08:33 AM (GMT Daylight Time, UTC+01:00)
# Monday, May 24, 2010

Episode 89

In this interview, Dane Morgridege describes the Entity Framework - an object relational mapping tool from Microsoft.

Monday, May 24, 2010 11:18:40 AM (GMT Daylight Time, UTC+01:00)
# Thursday, May 20, 2010

What I like about Paul Kimmel's LINQ Unleashed for C# is that he does not rush into explaining LINQ. Before explaining LINQ, Kimmel explains the new technologies that make LINQ possible.

He walks the reader through anonymous types, type initialization, extension methods, the yield return statement, lambda expressions, and closures - all features that were introduced in C#3.0 - before explaining how each of these features makes LINQ possible.

After building up to it, Kimmel steps through the syntax of LINQ, providing numerous code examples.

He begins with syntax to all implementations of LINQ; then dives into more detail about the major LINQ implementations: LINQ to SQL, LINQ to Objects, and LINQ to XML. In each section, he provides numerous helpful samples.

When I first opened this book, I was new to LINQ (Language Integrated Query) and had no grasp of how it works. This book got me up to speed. I recommend it for anyone learning LINQ.

Books | LINQ
Thursday, May 20, 2010 2:58:59 PM (GMT Daylight Time, UTC+01:00)
# Tuesday, May 18, 2010

As someone who once passed a bunch of tests (>40) to earn a bunch of Microsoft certifications(>20), I'm sometimes asked about the value of these certifications. Are they worth the time, cost and effort they take? What are the benefits? Who benefits most?

The real cost of certifications
More than the cost to sit the exam (typically $150) is the cost of studying for the exam. I used to spend weeks - at least a couple hours each day - studying for each exam. This cost tends to far outweigh the exam fee.

What do certifications prove?
A certification demonstrates a minimal level of competence in a given technology. They don't flag the holder as an expert; but, assuming you didn't cheat, they require knowledge of the subject matter in order to pass.

Everybody learns differently
I hope all of us can agree that it is not possible to succeed as a software developer, network engineer or database administrator without learning new skills every year. Each of us learns in a different way. I think most people learn a technology best when they have something to apply it to. This application serves as motivation to learn and retain knowledge. If your job doesn't provide that application, you need to create it yourself. This might be a personal or open source project or it might be a certification exam. Either way, if it helps you to learn a new skill by focusing on a tangible goal, that is a good thing.

When are certifications most valuable?
Certification is no substitute for experience, but it can help to supplement experience. This is especially true early in your career when practical experience is lacking. For those new to information technology or software development, it can be difficult to build up the experience necessary to impress a potential employer. A certification can help make up for a lack of experience, because you have demonstrated the ability to complete a goal and enough knowledge to pass an exam.

Some places require certification. Why?
Microsoft partners with companies in different ways. In some of these partnership arrangements, the partner company must have a certain percentage of their employees certified in Microsoft technology. Although far from perfect, it's a very simple way for Microsoft to vet their partners.

So is it worth it?
From a personal standpoint, I don't at all regret achieving the certifications that I did. I took most of the exams early in my career and they gained me some credibility. As recent as two years ago, potential employers asked me about my certification and were impressed when I provided it. I have learned a lot studying for these exams and that knowledge has helped my career. I doubt that I'll be taking many more exams. My free time is limited and I prefer to use more efficient ways to learn, focusing on building applications or preparing and delivering presentations.

My advice is to consider certifications early in your career to improve your skills and improve your credibility; then spend your time elsewhere as you solidify your credibility.

Tuesday, May 18, 2010 4:53:41 PM (GMT Daylight Time, UTC+01:00)
# Monday, May 17, 2010

Episode 88

In this interview, Microsoft Product Unit Manager Cameron Skinner describes the architecture tools that his team built into Visual Studio 2010

Monday, May 17, 2010 10:55:01 AM (GMT Daylight Time, UTC+01:00)
# Friday, May 14, 2010

Like most statistical measurements of large groups, the success of people in a given population usually forms a normal distribution or "bell curve". In other words, most people fall at or near the average level of success; and as we move further above and below the average, fewer and fewer people appear at each level until the number approaches zero far above and below the average.

But some people fall well outside the boundaries predicted by the normal distribution. These people are outliers.

In his book "Outliers", Malcolm Gladwell is primarily concerned with those outliers who excel far beyond the level expected. These are intellectual geniuses and musical prodigies and world-class athletes who achieve great success.

Becoming an outlier takes talent and hard work - a lot of hard work: 10,000 hours of dedicated practice, according to Gladwell.  For example, the Beatles owe their success in large part to the fact that they performed 8-12 hours a day for 2 years at the clubs in Hamburg, Germany, allowing them a chance to perfect their craft before they recorded their first hit records.

But Gladwell insists that enormous success takes more than talent and hard work. It takes luck. And that luck sometimes follows measurable patterns and those patterns can be predicted.

As evidence, he points to birth dates as a major factor in the success of many outliers. Bill Gates, Paul Allen and Steve Jobs were born within months of each other; Of the 75% richest people in history, 14 were born in the United States between 1831 and 1840; and the vast majority of elite Canadian hockey players were born during the first half of the year.

He then explains reasons why something as seemingly arbitrary as a birth date would affect one's chance at extreme success. In each case, he presents a plausible explanation of the cause and effect. Canadian hockey players born in January, for example, tend to be placed in the same league as the much younger players born in December of the same year. At a very young age, this can be a huge advantage, so the older, bigger, stronger January-born athletes tend to dominate the less mature December-born players. As the stronger kids stand out more, they get picked for the better leagues, where they receive superior instruction and more practice time (making it more likely they will be able to put in 10,000 hours of practice before adulthood).

Just as talent and hard work alone will not guarantee success, neither will lucky circumstances. But these things improve one's chances - sometimes drastically.  Not all Canadian hockey players born in January make it to the NHL. But almost none of those born in December do.

Gladwell's case studies are very interesting and very plausible. He supports his hypotheses primarily with anecdotal evidence. But he supplies enough statistics to support his conclusions.

These seemingly random factors are often predictable, so it is possible to modify our behavior and increase our chances at great success. Some of them (month of birth, for example) are beyond our own control; while others (year of birth, are only known to be success factors later on), so it's difficult to modify all our behavior.

Outliers challenges the notion that people achieve great success solely through talent and hard work. Outliers is an interesting study of his findings and worth reading.

Friday, May 14, 2010 11:28:21 AM (GMT Daylight Time, UTC+01:00)
# Thursday, May 13, 2010

The var keyword was introduced in C# 3.0 and is used to declare a new variable.

The var keyword looks suspiciously like the variant keyword from Visual Basic 6. However, unlike variant, var is used to specify a strongly-typed variable. The type of the variable is inferred by the value initially assigned to that variable. As a result, whenever we use var to declare a variable, we must assign a value to the variable on the same line. So

var myString = "Hello";

is valid, but

var myString;

is not.

As mentioned earlier, the type of a variable is inferred from the value assigned to it, so in the line

var myString = "Hello";

is equivalent to

string myString = "Hello";

and

var myNum = 99;

is equivalent to

int myNum = 99;

The compiler is smart enough to recognize that "Hello" is a string and 99 is an integer and type the variable appropriately. This type checking is done at compile time, so the following code is invalid and will not compile

var x = 99;
x = "Hello";

because x is an integer, it is not possible to assign a string to it and the compiler knows this.

The var keyword is also smart enough to infer data types from the return types of functions. For example, if I have a function that returns an int and I assign the results of that function to a variable declared with the var keyword, that variable will be defined as an int. Here is a sample

static int AddNumbers(int x, int y)
{
return x + y;
}
var sum = AddNumbers(2,3);

The variable sum is an int because AddNumbers returns an int.

Earlier this year, following a user group presentation and someone noticed my use of the var keyword in my demos. The appropriateness of var became a Twitter debate and the subject of at least one blog post.

As long as I follow the rules, the compiler doesn't care whether I declare a variable using var or the explicit data type. So when do I use var? I use var when I think it will improve readability.

Consider the following 2 (equivalent) lines of code

Line 1: Customer cust = new Customer();
Line 2: var cust = new Customer();

Both lines are the same as far as the compiler is concerned. But the second line of code is more concise and easy to read. I have communicated the same information in a shorter command and with no loss of information. It should be obvious to anyone reading the second line that the variable cust contains a Customer object. In this case, I would declare the variable with the 'var' keyword because it is more readable.

The last example may not seem like there is much difference in readability between the two lines, but check out the following two equivalent lines

Line1: Dictionary<int, string> dict = new Dictionary<int, string>();
Line2: var dict = new Dictionary<int, string>();

Clearly, Line2 is more readable than Line1 in this case.

Now consider the following (equivalent) lines of code

Line 1: Customer cust = RetrievePrimaryCustomer();
Line 2: var cust = RetrievePrimaryCustomer();

Both lines are the same as far as the compiler is concerned. But I can't be sure, just from looking at the declaration, what data type is returned by the RetrievePrimaryCustomer method. The compiler knows the type, but I need to go through one or more manual steps to figure it out. In this case, the first option is more readable because it provides to anyone reading my code more information about the variable.

So my rule for using var is simple:

If the data type is obvious to anyone reading my code, use the var keyword; Otherwise explicitly specify the data type.

The var keyword is a useful shortcut that can help make your code more readable.

C#
Thursday, May 13, 2010 12:42:27 PM (GMT Daylight Time, UTC+01:00)
# Wednesday, May 12, 2010

Episode 87

In this interview, Day of .Net organizers John Hopkins and Jason Follas describe what went into planning this event and what were the results.

Wednesday, May 12, 2010 5:04:36 AM (GMT Daylight Time, UTC+01:00)
# Monday, May 10, 2010

Episode 86

In this episode, David Hoerster describes how he uses jQuery and WCF to create rich, interactive applications.

Monday, May 10, 2010 11:18:51 AM (GMT Daylight Time, UTC+01:00)
# Wednesday, May 5, 2010

Episode 85

In this show, David Isbitski and Matt Van Horn describe Behaviors, a feature that allows you to easily enhance the user interface of your Silverlight applications.

Wednesday, May 5, 2010 12:09:02 PM (GMT Daylight Time, UTC+01:00)

Microsoft Product Unit Manager Cameron Skinner came to the midwest to show off the Architecture features of Visual Studio 2010. He began his tour in the Detroit area, speaking at local companies in the afternoon and at the Great Lakes Area .Net User Group (GANG) in the evening. I recorded two of his presentations, which are available here.

Here is the presentation at GANG

Part 1:

Part 2:

Part 3:

Part 4:

Part 5:

Here is the presentation at a Detroit-area company.

Part 1:

Part 2:

Part 3:

Part 4:

Wednesday, May 5, 2010 3:04:35 AM (GMT Daylight Time, UTC+01:00)
# Monday, May 3, 2010

Episode 84

In this interview, John Petersen describes how to use jQuery, JSON and Ajax to enhance an ASP.Net MVC application.

Monday, May 3, 2010 11:28:46 AM (GMT Daylight Time, UTC+01:00)