• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

does work get any more boring then this?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

johnjbruin

Diamond Member
Jul 17, 2001
4,401
1
0
i comment pretty liberally now - was flamed a lot for not commenting when i started my job - now i am supposedly the best "comment-er" in our group
 

badmouse

Platinum Member
Dec 3, 2003
2,862
2
0
When I first started programming 20-odd years ago I did a lot of commenting. Then I came to realize, after going back and looking at the programs, that most of the comments were useless, stupid, time wasting, and embarassing. So I cut way down.

Good commenting is a skill that is best learned by looking at a lot of old code and figuring out what would have been nice to know more about.

However, good obvious code beats commenting any time.
 

StageLeft

No Lifer
Sep 29, 2000
70,150
5
0
However, good obvious code beats commenting any time.
That's for sure.

While I won't pretend that I fall into that group, virtually nobody here comments, as I mentioned above.

If you understand the business rules of a project decently you can generally figure out what the code is doing anyway by looking at class names and following through on events. Unless the commenting is huge and extensive, like a big paragraph at the beginning of a class, it's often not worth doing. Typically I comment when I've written something that is very weird, or looks like it was done improperly and I have to explain why it wasn't done improperly.
 

NuclearNed

Raconteur
May 18, 2001
7,882
380
126
I can live without comments because generally with a little time I can figure out the programmer's intent just from the code.

One of my biggest pet peeves is when someone doesn't indent their code, or indent it properly and consistently. In my opinion, this makes the code much less readable. I hate it so much that I'll usually take extra time to shape up the code. I think the worst has to be SQL - people around here try to fit as much functionality in a single line as possible, when they could make it so much better if they indented it just like a regular programming language.
 

CChaos

Golden Member
Mar 4, 2003
1,586
0
0
I may have you beat for boring. I'm writing regression test plans for an OS upgrade. Ideally, we have to hit every single line of code in our application. I'm up to ~170 pages and still going.
 

SWScorch

Diamond Member
May 13, 2001
9,520
1
76
I comment a LOT, but only because my boss yells me unless 3 out of 4 lines of code are documented. I mean, do you really need to comment this?

for i = 0 to intArraySize
array(i) = ""
next

or

formHelpWindow.Show
msgBox "Hi There!"

but no, I have to comment every single thing I write.

I do try to have well-named variables, but my friend here uses stuff like strThingy1, strThingy2, txtStuff, intBlah4, etc...
 

skace

Lifer
Jan 23, 2001
14,488
7
81
I comment the contents of each variable. I also comment what each function is used for. Above and beyond that, I don't comment much. Commenting variables and functions allows someone to quickly parse through the program and get to where they want to edit / fix / break / etc.
 

stonecold3169

Platinum Member
Jan 30, 2001
2,060
0
76
Sounds like my op sys programs that my professor would hand out... line after line of a program for, say, making and spawning command lines and parsers with single letter undescriptive variables being passed everywhere... I had no clue what was going on with those unless I spent multi hour sessions doing it
 

Ameesh

Lifer
Apr 3, 2001
23,686
1
0
after working in the industry for several years and being burned by bogus comments a few times, i don't trust them. i just read the code and figure out whats going on, but i still do comment my code.