Finding Bugs in my code with And vs. AndAlso
Not trying to start a holy war over VB,C#, short-circuiting, and not short-circuiting, but I thought this was somewhat interesting. I have some VB.NET code that uses "AndAlso". I switched it to "And" due to some user requirements changing. Bang I found one interesting error when I am looping through the elements of a datagrid and using the FindControl() method to get the specific control. I had misspelled the control name. Yeah, Yeah, I know about having a test plan and all that. My point is that I had never thought of finding bugs as a possible reason to not short-circuit. In this case, the problem would have been found because the entire process would not have completed, but not quite as quickly.
Wally