Darren Winsper (dwinsper) wrote,
Darren Winsper

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.
  • Post a new comment


    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded