Is code commenting bad?

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

KIAman

Diamond Member
Mar 7, 2001
3,342
23
81
but it might save you and others looking at the code a lot of time down the road


What I find funny is that kind of argument. If someone works 8 hours a day, how much time is spent doing actual work? 6 if you are lucky.

Sorry, I've been down the path of WTF does this uncommented code do one to many times.

Sorry for causing a slight rant in this thread but obviously you guys didn't read this entire thread and the previous responses.

Code commenting is not all black or white. I was not advocating that you should never comment your code. My previous response summed up my opinion on the matter in that you should strive to write readable code then reasonable header commenting, then inline comments if it is not obvious what the code is doing.

Some people understand the scale of projects and how a good coding process and commenting can scale from simple projects to millions of LOC projects.

For small stuff, I have no problems commenting too much, especially if I know a junior programmer is going to maintain it.

For large projects, commenting must be STRICTLY managed as much as code version control and those who understand code maintenance also understand that an over abundance of frivolous commenting can actually HINDER the process and cost a significant amount of time to fix. Remember, you maintain the code AND the comments. They cannot ever be out of sync.

My biggest pet peeve for large code is commented out code. Really? If the code has version control, DELETE THE DAMN CODE, especially if it was WRONG in the first place! If people want to see what was removed, they can look through the version control system or repository.
 

LokutusofBorg

Golden Member
Mar 20, 2001
1,065
0
76
My biggest pet peeve for large code is commented out code. Really? If the code has version control, DELETE THE DAMN CODE, especially if it was WRONG in the first place! If people want to see what was removed, they can look through the version control system or repository.

Heh. I started a new job a month ago, and my first project here is the fourth attempt to get a fairly simple interface to an external service in place. Two of the previous attempts left their code in place. One of them at least commented out the root method call, but the other one didn't and it's currently logging errors in production. I went over and talked to the one developer that at least commented out his method and he said "oh yeah, that can all probably be deleted now."

/facepalm
 

AyashiKaibutsu

Diamond Member
Jan 24, 2004
9,306
3
81
My biggest pet peeve for large code is commented out code. Really? If the code has version control, DELETE THE DAMN CODE, especially if it was WRONG in the first place! If people want to see what was removed, they can look through the version control system or repository.

This pisses me off too. When I first got here they were trying to rely on comments for version management... Like the code wasn't enough of a mess without giant sections commented out. I managed to convince them to at least load up visual source safe. The funny thing is the code I work on is a configuration management webapp...
 

Stuxnet

Diamond Member
Jun 16, 2005
8,403
1
0
Ugh... I'll be stuck using SourceSafe again soon, too (going out on my own again). That pile of shit is one step above using a whiteboard for VC. I tried to convice them to move to SVN (they're very budget conscious and need to support branched development). They said some of their developers found it too intimidating (then fire those idiots - problem solved). I convinced them to at least move to TFS, which means we'll get a build server, too. When I start talking about continuous integration their eyes gloss over and one of the SPA's looks like she wants to cry.

I have to admit I've grown really jaded working in software development. There are just SO MANY SHITTY DEVELOPERS out there. Take some pride in your craft for @#$% sakes!!!! Too many people just want to come in to work, hack their way through the next 8 hours with a machete, and go home. I'm all down for the going home part, but tomorrow is going to SUCK for whomever gets your mess dumped in their lap. If things like SVN and CI make you tremble, you need to cart your ass back to your first data entry or computer operator job.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |