M9 1a8 8 0 1 0 0 16A8 8 0 0 0 9 1zm. M9 1a8 8 0 1 0 0 16A8 8 0 0 0 9 1zM8 15. What are the pros and cons of standardizing on using Option 105 in binary option Text vs Option Compare Binary for VB.
Just some background since it seems like it would help – my development team has found it much easier to standardize on Option Strict On, Option Infer On, and Option Explicit due to their obvious advantages over the alternatives. Binary as there seem to be advantages and disadvantages to both and different developers have differing opinions. Data needs are rarely concerned with casing, as evidenced by most databases being case-insensitive. Rarely would you ever really want to distinguish between THIS and This and this when doing a data comparison. Certain specific use cases are simpler when you don’t have to worry about casing.
NET control events where commands are sent to the codebehind as strings and casing-issues are difficult to track down as the compiler cannot help you. Many of the concerns raised about text comparison concern internationalization, which is often not that relevant to a lot of applications. VB specifically is case insensitive as a language, though Visual Studio helps you by at least enforcing consistency in your casing. SQL is case insensitive as well. Strings are the only place where you have to remember to worry about it, which highlights the awkwardness in ways you wouldn’t normally notice it if you were worried about it everywhere. It’s somewhat unexpected to have alternate behavior and the unexpected is not good in programming. There is a slight performance penalty with Option Compare Text as evidenced by the IL generated on compile.
Option Compare Binary doesn’t have that penalty. Option Compare Text only makes certain parts of string handling case insensitive. But, it doesn’t make it so that things like dictionary indexing are case insensitive by default. So, it’s not like Option Compare Text actually makes it so that you don’t have to worry about casing at all.