4 ms·
Do most programmers really go through a "MUST COMMENT EVERYTHING" phase? I never did. If anything, I probably commented too LITTLE as opposed to too MUCH. In
by sspencer 19y ago
Do most programmers really go through a "MUST COMMENT EVERYTHING" phase? I never did. If anything, I probably commented too LITTLE as opposed to too MUCH. In fact, I rarely comment more than the beginnings of new functions/methods/def*s.
Maybe I'm not doing anything sufficiently tricky in my functions?
- pchristensen 19y agoI was wondering if I was the only one!
- cstejerean 19y agoI've yet to meet a "junior" programmer that overly comments code. OTOH I've met a couple of more senior level developers (15-20 years of experience) that absolutely can't live without documentation and comments even when the comments simply reiterate what the code is saying (still not to the level of narrative Steve was suggesting)
- Goladus 19y agoI began over-commenting in college when the professors asked for detailed comments but didn't exactly specify how much detail was enough. (Or, they tried to explain what comments were appropriate but failed miserably). Grade-wise, it was safer to have too many than too few.
- danohuiginn 19y agoComments, like anything to do with writing maintainable code, take a while to learn. You only really figure out which comments are useful when you come back to something you wrote a couple of years ago, and try to make sense of it. So, new programmers are likely to write bad comments, more than they are likely to write bad code (because bad code is more obvious the day you write it, so the feedback comes faster). How the comments are bad, though, is going to vary between programmers. Some will write too many, some too few, some will just write plain useless comments. My disease was like Steve's - over-commenting. I put it down to my liberal-arts background, which meant I found it much easier to think in prose than in code. Accordingly, I would get my head round tricky problems by writing a comment about them first. I wonder if programmers from a straight CS background would tend to write fewer comments.