Naming Conventions for Visual Controls

G

Guest

Hi Friends,

We are defining coding standards for our company.

In MSDN i have seen that hungarian notation will not be used in naming of
variables etc. What about the controls ? Should we eliminate prefixes from
these also. What do u suggest?


Thanks in Advance
Lalit
 
D

Daniel O'Connell [C# MVP]

Lalit said:
Hi Friends,

We are defining coding standards for our company.

In MSDN i have seen that hungarian notation will not be used in naming of
variables etc. What about the controls ? Should we eliminate prefixes from
these also. What do u suggest?

That is a difficult question, ;).

Naming control variables is difficult, and since in general they are private
variables you should feel free to use whatever convention best suits your
company. Using hungarian is probably easier if you are doing alot of direct
codiing against controls and using standard naming(as in nameTextBox) when
the majority of control work will be handled in a designer or codegen. But
again, that is a matter of comfort.

I personally use of VB6 style hungarian naming for simple controls(lists,
text boxes, buttons), but do not use them for composite controls or more
complex third party controls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top