View Poll Results: Do you prefer your code organized?
- Voters
- 17. You may not vote on this poll
-
Yes, both commented and indented correctly at all points.
-
Mostly commented correctly, with a few indents where I find necessary.
-
I occasionally use comments and indents.
-
It is not entirely necessary to comment and indent code.
-
Nov 6th, 2002, 07:12 PM
#1
Thread Starter
Lively Member
Organized Code
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
www.mindset1.com
Religious Debate Forums
-
Nov 6th, 2002, 07:25 PM
#2
Stuck in the 80s
Organized code can be the key to success. You'll thank yourself later.
-
Nov 6th, 2002, 07:39 PM
#3
Good Ol' Platypus
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.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Nov 6th, 2002, 07:42 PM
#4
^:^...ANGEL...^:^
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...
-
Nov 6th, 2002, 07:58 PM
#5
PowerPoster
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").
-
Nov 6th, 2002, 07:58 PM
#6
Stuck in the 80s
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.
-
Nov 6th, 2002, 08:08 PM
#7
Addicted Member
i'm with sastraxi, i ALWAYS use indents, only occasionly with something obscure do i use comments
-
Nov 6th, 2002, 08:11 PM
#8
Fanatic Member
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.
-
Nov 6th, 2002, 08:19 PM
#9
So Unbanned
Sometimes I'll tab out my nests.
Depends on my laziness.
-
Nov 6th, 2002, 08:24 PM
#10
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.
Amen to both of those. Besides "normal" comments I annotate my code like the following when making changes.
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.
-
Nov 6th, 2002, 08:24 PM
#11
Hyperactive Member
Commenting is something is i forget sometimes, but indentation has become second nature to me. I can't imagine coding without indentation.
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Nov 6th, 2002, 09:48 PM
#12
Stuck in the 80s
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
-
Nov 6th, 2002, 09:51 PM
#13
Hyperactive Member
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
We don't know what's wrong. . . So the best bet might be to remove something surgically.
-
Nov 6th, 2002, 10:06 PM
#14
Thread Starter
Lively Member
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.
www.mindset1.com
Religious Debate Forums
-
Nov 6th, 2002, 10:21 PM
#15
Addicted Member
Well I indent, but I NEVER comment
-
Nov 6th, 2002, 10:25 PM
#16
Fanatic Member
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
ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
Programming is fun, but only if you're not on a tight deadline 
So I consider all those working engineers sad people
VB FTP class
3 page PHP crash course
Crash Course on DX9 Managed with VB.NET covering basics till terrain creation
-
Nov 6th, 2002, 10:31 PM
#17
Stuck in the 80s
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
I might do that sometimes, but I'd do backwards indentation:
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
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
|