Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
Please can you share some good practices in object/ variable naming conventions? I am planning to build a report which uses macros & triggers… So I thought I would take some inputs in terms of naming conventions followed.
Thanks in anticipation!
Cheers - DV
In my practice, the best naming conventions are based on simple common sense and consistency:
1. Field names should be as close to "human readable" format as possible. For example, most developers will have fields like:
"Supplier Code",
"Supplier Name - Short",
"Supplier Name - Long"
In this case, the Designer will be forced to always rename one of those fields into "Supplier" - in every chart and every list box. My recommendation would be to pick one of the fields as the "main" representation of Supplier, and call it simply "Supplier", to avoid constant renaming.
2. For variables, I'd recommend following 3 simple rules:
- using a prefix "v" to distinguish variables from fields,
- Type full variable name, trying to avoid abbreviating - for example, vTargetGrossProfitMargin and not vTGPM
- Consistently using Mixed casing (each new word starts with a capital letter) - for better readability
I'd be happy to learn additional recommendations from other developers.
cheers,
In my practice, the best naming conventions are based on simple common sense and consistency:
1. Field names should be as close to "human readable" format as possible. For example, most developers will have fields like:
"Supplier Code",
"Supplier Name - Short",
"Supplier Name - Long"
In this case, the Designer will be forced to always rename one of those fields into "Supplier" - in every chart and every list box. My recommendation would be to pick one of the fields as the "main" representation of Supplier, and call it simply "Supplier", to avoid constant renaming.
2. For variables, I'd recommend following 3 simple rules:
- using a prefix "v" to distinguish variables from fields,
- Type full variable name, trying to avoid abbreviating - for example, vTargetGrossProfitMargin and not vTGPM
- Consistently using Mixed casing (each new word starts with a capital letter) - for better readability
I'd be happy to learn additional recommendations from other developers.
cheers,
Thank you very much!
I am expecting more responses from other members.
Cheers - DV
I would also like to hear the experts' voice in terms of object naming convention (textbox: txt_; listbox: lst_; etc.), lenght, etc.
I know I can make my own one, but wonder if there is a best practice.