|
-
Feb 3rd, 2008, 02:41 PM
#1
Thread Starter
Fanatic Member
Good programming etiquette
I have a question re good programming etiquette. I have textboxes in a control array (called txtData()). The thing is, I need to replace txtData(9) with a combobox and txtData(13) with a combobox.
Now, I use a For...Next to transfer these values to a recordset to write to file.
Would it be GOOD practice to keep coding short and call the comboboxes txtData()
or
should we stick to the naming conventions and move the data to the recordset in a Select Case... statement
Your thoughts would be appreciated
-
Feb 3rd, 2008, 03:01 PM
#2
Thread Starter
Fanatic Member
Re: Good programming etiquette
OK, the above example won't work because all controls in an array must be of the same type.
But, the idea of naming convention in general... Rigid? or anything goes?
-
Feb 3rd, 2008, 03:36 PM
#3
Re: Good programming etiquette
Thread moved to General Developer Forum
The reason for naming conventions is so that you can tell what something is just by looking at the name.. if you are going to give a combobox a name that makes it seem like a textbox, it will lead to confusion (and would actually be worse than not having a naming convention at all). For that reason I would say that it should be rigid.
The route you should take (and as you have found, need to) is to change the code to deal with the different kinds of object.
-
Feb 3rd, 2008, 10:00 PM
#4
Re: Good programming etiquette
You're describing Systems Hungarian notation. Opinions are divided on whether this notation is of any use at all. It's very common amongst VB6 coders but not really popular in any other language, from what I have seen.
There isn't any sort of global standard naming convention; it is just a matter of personal taste (for hobbyists/freelancers) or in-house style (for professionals).
That debate aside (it's been done here many times before), if you're going to use a notation you might as well stick to it — as Si says — otherwise it is pointless.
-
Feb 4th, 2008, 07:37 AM
#5
Re: Good programming etiquette
Use descriptive variable names. But not names like:
Code:
For Counter1ForMyForLoopIteration 1 to UBound(MyArrayWithStockItemsIn)-1
Next Counter1ForMyForLoopIteration
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|