This poll is just to determine how many people actually take the time to organize their code, and organize it well. Just out of curiosity :)
Printable View
This poll is just to determine how many people actually take the time to organize their code, and organize it well. Just out of curiosity :)
Organized code can be the key to success. You'll thank yourself later.
I don't use comments but I always, ALWAYS use correct indentation and spacing. Just to make it easy to skim through, I will occasionally add 'stage' comments in long functions and procedures.
I use indentation but comments are only if something is new for me and its the first time I am using...
when I am used to that bit of code I remember it and I don't use comments any more...
Cheers...
When you write any program ALWAYS think maintenance which means as much comments as possible as you might not be the one that will ever support that piece of art (read "crap").
If something is either partially complicated or really involved, I'll comment it.
I can't count the times I'll look at code I wrote months ago and have no idea what's going on. :(
Always use Option Explicit, too. It's the best coding practice to get into the habit of doing.
i'm with sastraxi, i ALWAYS use indents, only occasionly with something obscure do i use comments
I make lines with comments after the normal horizontal lines on vb, like this:
VB Code:
'====================================================================
because it's easier to see than the regular lines...
and I always indent correctly. :D
Sometimes I'll tab out my nests.
Depends on my laziness.
Amen to both of those. Besides "normal" comments I annotate my code like the following when making changes.Quote:
Originally posted by The Hobo
If something is either partially complicated or really involved, I'll comment it.
I can't count the times I'll look at code I wrote months ago and have no idea what's going on. :(
Always use Option Explicit, too. It's the best coding practice to get into the habit of doing.
VB Code:
'******* 12.00.004 #2 Start ******* ' For InIndex = 0 To cboRules.ListCount - 1 ' cboRules.RemoveItem intIndex ' Next cboRules.Clear '******* 12.00.004 #2 End *********
The above would tell me that I replaced the loop with the Clear statement in release 4 of version 12.0 of my app. BTW, I wrote a liitle add-in that helps me with the annotation.
Commenting is something is i forget sometimes, but indentation has become second nature to me. I can't imagine coding without indentation.
Here's a question: Indentation - do you have it set at 2 or 4 spaces?
I've seen some people's code where it's at like 8 and it bugs the crap out of me. I'm very picky about my code.
I also don't like this:
VB Code:
Dim var As Type Dim var As Type Dim var As Type Dim var As Type Dim var As Type Dim var As Type
I'd rather have it:
VB Code:
Dim var As Type, var As Type, var As Type Dim var As Type, var As Type, var As Type
mines 4, 2 is too close to see, and 8 goes off the screen too quickly. I prefer the first option on the variable declaration though. . it is easier to read when the variables names are different lengths
Personally, I'm very picky about my code. I told some of you about my Tic Tac Toe game (T3-2K5). If you want to see that code, go to www.planetsourcecode.com and just search for T3-2K5 under the VB category. Download it and look at my code, that'll give you an idea. Almost every line is commented (which i admit is a bit ridiculous ;)) and every indent is correct.
Well I indent, but I NEVER comment :p
I'd rather
VB Code:
Dim var As Type, var As Type, var As Type, _ var As Type, var As Type, var As Type, _ var As Type, var As Type, var As Type, _ var As Type, var As Type, var As Type
I might do that sometimes, but I'd do backwards indentation:Quote:
Originally posted by jian2587
I'd rather
VB Code:
Dim var As Type, var As Type, var As Type, _ var As Type, var As Type, var As Type, _ var As Type, var As Type, var As Type, _ var As Type, var As Type, var As Type
VB Code:
Dim var As Type, var As Type, var As Type, _ var As Type, var As Type, var As Type, _ var As Type, var As Type, var As Type, _ var As Type, var As Type, var As Type