Nov 24
Control Naming on Forms
Another classic hard problem: how do you name controls on a form? Do you follow a certain guideline? What are the options?- Hungarian Notation
- Full name
- Something Better?
This convention avoids problems with changing control types (textboxes to drop-down lists, or simple text box to some uber textbox, or text box to date picker, for example), and groups the items together in intellisense. It is also much shorter than most Hungarian conventions, and definitely shorter and less type-dependent than appending the control type to the end of the variable name. I will use generic suffixes which allow me enough freedom to change them around.The freedom to change controls without changing names is pretty useful. In the absence of any compelling naming convention, the one with the most pragmatic points wins. So I'm going to try the modified Hungarian in my next project and see how I like it.
