| Darren Winsper ( @ 2006-11-28 16:59:00 |
Is VB.Net retarded? Let's find out!
Right, time for the answer to my previous riddle. The output of the code I posted is...a NullReferenceException! Yes, that's right folks, VB.Net will try to dereference a null (Nothing) reference despite the fact that you're blatantly checking for it and taking steps to prevent it. This is because VB.Net will evaluate both code paths in the inline-if statement. Thus, VB.Net is retarded, or insane, whichever you fancy.
Right, time for the answer to my previous riddle. The output of the code I posted is...a NullReferenceException! Yes, that's right folks, VB.Net will try to dereference a null (Nothing) reference despite the fact that you're blatantly checking for it and taking steps to prevent it. This is because VB.Net will evaluate both code paths in the inline-if statement. Thus, VB.Net is retarded, or insane, whichever you fancy.