Post

I'm probably going to make someone mad, but...

this has got to be one of the dumbest features in VB.NET. It’s bit me a few times when I’ve had to help someone on their machine and I go looking using Intellisense for something and it’s not there. My brain is telling me that there’s something there that I can use, but can’t remember the name of it. So what was it called… ummm… look through the list and can’t find anything that is ringing a bell. Low and behold, the default is to hide “advanced members”. What exactly is “advanced”? Who decides this? Also, I thought that Intellisense was supposed to be “everything” accessible in a given context. Why hide anything?

As a simple example, why is it that CanFocus is hidden? Don’t you think that it would be nice to see if a control can accept being focused prior to just blasting a Focus() method and checking to see if it was successful after the fact. On top of this, even the sample in the online help shows the usage of CanFocus:

1
2
3
4
5
6
Public Sub ControlSetFocus(control As Control)
  ' Set focus to the control, if it can receive focus.
  If control.CanFocus Then
     control.Focus()
  End If
End Sub

Based on the property being hidden in Intellisense, you’d think you would write the code as:

1
2
3
4
5
6
7
Public Sub ControlSetFocus(control As Control) 
  ' Set focus to the control, if it can receive focus.
  Dim success As Boolean = control.Focus()
  If Not success Then
      ' Handle accordingly.
   End If
End Sub

Now from a C# vs VB.NET perspective… no wonder there’s a stigma surrounding VB being for a “lesser” crowd.

This has got to be one of the dumbest “features” in VB.NET today… not to mention… extremely buried. Yeah… the first place I would go look is in Tools, Options, Text Editor, Basic, General. Not to mention, this is just downright insulting… there is NO productivity gain of ANY KIND by hiding these so-called “advanced members”! So what exactly was the point of hiding them?

This post is licensed under CC BY 4.0 by the author.