Here's my recommendation:
If you have already set Option Explicit On and Option Strict On (at whatever level)
- Turn off Option Infer in the IDE and project properties
- Turn on Option Infer in code files when you need it. This ensures that code is easy to read, and when it is on, it alerts the reader to be on the lookout for its use and reminds them to hover over the var to see its type.
When Option Explicit is Off...
Turning Option Infer On allows old VB6 code full of variants to compile and run better since the compiler assigns a type to the vars at compile time, rather than allowing the var to be late bound. However, testing should be done to ensure that vars do not store multiple types during their lifecycle.
NOTE: This is not a substitute for a proper refactoring of VB6 code ported to dot NET. Variants are bad, children, mm'kay?