Digitborn.com
Active Member
- Joined
- Apr 3, 2007
- Messages
- 353
Hello,
Though I've looked about 20-30 internet pages, several ebooks and comments about the topic I'd like to ask you about it
If I use many different controls on a userform what's the best way to name them? I think that it's very good if the name to consists of 3 parts:
1. Control Name
2. Control #
3. The purpose of the control
For example - if you have a ComboBox where you choose fruits from Africa and it's the 3rd ComboBox from left to right & up to bottom, I think it should be best if you name it: Combo3AfricaFruits
Yes, I know it's very long, and it's not good to remember. But this is a rule which make you find everything and gives you a lot of information about the things you're doing in your code and as a whole.
Otherwise what options you have taking the recommendations: AfricaFruits, Fruits, ComboBox3, Africa...short, nice, but not good enough. Why?
1. If you miss to name the control and give a name like AfricaFruits, you won't know if it's for the TextBox or the ComboBox
2. If you miss the number and name it ComboAfricaFruits and you look the design of the form where you have 6 ComboBoxes, 3 TextBoxes, 1 Mulitpage, 5 CheckBoxes, 4 OptionButtons, 10 Labels, CommandButtons etc.. it will be a total mess for you to make a good plan for design and code functionality and validation.
3. And maybe the most important if you name only ComboBox3, it's no good and no need to comment at all.
This is my opinion, let me know what's your point of view
Though I've looked about 20-30 internet pages, several ebooks and comments about the topic I'd like to ask you about it
If I use many different controls on a userform what's the best way to name them? I think that it's very good if the name to consists of 3 parts:
1. Control Name
2. Control #
3. The purpose of the control
For example - if you have a ComboBox where you choose fruits from Africa and it's the 3rd ComboBox from left to right & up to bottom, I think it should be best if you name it: Combo3AfricaFruits
Yes, I know it's very long, and it's not good to remember. But this is a rule which make you find everything and gives you a lot of information about the things you're doing in your code and as a whole.
Otherwise what options you have taking the recommendations: AfricaFruits, Fruits, ComboBox3, Africa...short, nice, but not good enough. Why?
1. If you miss to name the control and give a name like AfricaFruits, you won't know if it's for the TextBox or the ComboBox
2. If you miss the number and name it ComboAfricaFruits and you look the design of the form where you have 6 ComboBoxes, 3 TextBoxes, 1 Mulitpage, 5 CheckBoxes, 4 OptionButtons, 10 Labels, CommandButtons etc.. it will be a total mess for you to make a good plan for design and code functionality and validation.
3. And maybe the most important if you name only ComboBox3, it's no good and no need to comment at all.
This is my opinion, let me know what's your point of view