MrKowz
Well-known Member
- Joined
- Jun 30, 2008
- Messages
- 6,653
- Office Version
- 365
- 2016
- Platform
- Windows
Time for the weekly ponderable!
In your coding practice, what do you prefer? Do you create descriptive variables such as "HideCount" to count the number of rows hidden; "Delim" to serve as a delimiter; etc. Or do you create simple, nondescriptive variables and create a block of comment(s) that describe what each variable is?
Eg:
Or do you prefer to do a hybrid of the two?
Personally, I like to use descriptive variables (even though it can make some lines seem decently long). I find it makes it easier to go back and debug/review code. When it is one-off code, I still tend to use descriptive variables; but on larger code that has quite a few variables (usually over 10 or so), I will also write a block of comments to describe the variables.
In your coding practice, what do you prefer? Do you create descriptive variables such as "HideCount" to count the number of rows hidden; "Delim" to serve as a delimiter; etc. Or do you create simple, nondescriptive variables and create a block of comment(s) that describe what each variable is?
Eg:
Code:
'Variable Declaration
' h = Number of Rows Hidden
' d = Delimiter string
Dim h As Long
Dim d As String
Personally, I like to use descriptive variables (even though it can make some lines seem decently long). I find it makes it easier to go back and debug/review code. When it is one-off code, I still tend to use descriptive variables; but on larger code that has quite a few variables (usually over 10 or so), I will also write a block of comments to describe the variables.