Logic error:
If myObject Is Nothing Then
'...
End If
If you meant to test if the object was NOT nothing (i.e. "If myObject IsNot Nothing"), that could be considered a simple logic error.
Yeah, but that's kinda silly.. Youre right, but what are you going to do.. Fill a whole thread with things on the same banal level as "Make sure you write NOT if youre checking for something that is the opposite of what the check method does" - it's about as useful as saying "if you want to test that a String contains some text, dont use the Replace() method"
i.e. if a coder cant figure out what the error is here, and needs to be told in advance just so they can avoid it.. They probably dont have the intellectual capacity to be a programmer. I dont mean to sound elitist, but really, there are some problems that are meant to weed out the non-hackers
Run time error:
Dim X As ArrayList
X.Add("Hello world!")
I'd actually expect that to raise a compiler warning or error "Use of un-instanciated variable X"
If ArrayList had a Shared "Add" method, then there would be no runtime error. But it doesn't, so you need to declare it with "Dim ... As New ArrayList"
Similarly if the coder is calling a shared method on an instance, a warning of "Use of shared member via instance variable; qualifying result will not be evaluated" or something, appears...