Possible Duplicate:
Best Practices: Option Infer
What is the best way to mix VB.NET's Option Strict and the new Option Infer directives?
I am developing a old solution, that was translated from VB6 to the VB.NET.
Actually, the default options in files are
Option Strict On
Option Explicit On
I want to use LINQ, and found that is easier to use also the Option Infer On
.
Less to write, less (so, easier) to read.
However, a (conservative, from my point of view) part of the team keeps the Option Infer Off and insist do not use it at all, without explicitly explain the causes.
In your opinion, what are the "dangers" of using Option Infer On, along with other two options (Strict and Explicit, both On)?
Option Infer
off. But yes, I'm old school and "conservative" when it comes to things like this. I'd rather the compiler catch my errors than my having to debug them at run-time. I don't mind the extra typing; between IntelliSense and being able to type quickly, it's not much of a problem. – OpossumOption Explicit
andOption Strict
should always be on. – Opossumvar
orauto
keyword. The syntax with Option Infer looks broken to me, but that's probably because I still work in VB 6 occasionally. I'm all for the compromise of turning Option Infer off at the project-level, but selectively turning it on in individual code files where an extensive use of LINQ actually means that it improves readability. – OpossumOption Infer
directive. Whatever it does would be what would change by having it on or off, objectively speaking. Everything else is stylistic and inherently subjective. Not that there's anything bad with talking about style. – Opossum