Option Infer: Round Two
First, the good news!
Part 11 of the Visual Basic Express 2008 Tutorial has now been posted. For those following along, the tutorial was originally written for VB.NET Express 2005 and has been revised (for the third time) to update it to 2008!

One of the topics that was revised and extended was a discussion of Option Infer since it's new to VB.NET 2008. I covered this initially in a blog posted a few days ago: Option Infer in VB.NET 2008. A more thorough investigation, however, made me start to question the value of this new option. At a minimum, the documentation needs to be improved.
Traditionally, the value of Option Explicit and Option Strict has been to detect type errors. (Assigning a string to an Integer type is a very obvious example that is disallowed by Option Strict.) Option Infer doesn't do much to help out there. It does make coding a bit faster and facilitates Intellisense, but I ran into at least one example where code would work just fine in VB.NET 2005 and crash on a runtime error (the worst kind of error) when the only change is to upgrade to VB.NET 2008.
Here's the code -- This runs fine in VB.NET 2005:
Dim myVar = 12345
Debug.WriteLine( _
"After Assignment to Integer: " _
& myVar.GetType.ToString)
myVar = "whatever"
Debug.WriteLine( _
"After Assignment to String: " _
& myVar.GetType.ToString)
If you add the same exact code to a VB.NET 2008 project, it crashes with an InvalidCastException error. But note my exact words. If you upgrade the code instead, Option Infer is set to Off by default instead of the default of On for new projects.
Maybe this is why.
But it gets worse. If you upgrade a project and then check "Tools > Options > Projects and Solutions > VB Defaults" you get the wrong answer. This tells you that Option Infer is On for both upgraded and new projects. You have to look at Compile tab of the project's Properties window to see what it actually is. I'd call this a bug in the VB.NET 2008 Express development environment at least.


Comments
One reason that it was added to the language was because Linq needs it. http://www.danielmoth.com/Blog/2007/02/decomposing-linq.html
“Need” is a subjective word. You could code LINQ without it. It would take more code and the code wouldn’t be as neat and tidy.
I’m doing my third article on LINQ innovations right now and you’re right … most of the VB.NET 2008 changes were made to support LINQ.