![]() |
|
| View Poll Results: Do you comment your code? | |||
| All the time |
|
17 | 29.31% |
| Sometimes |
|
35 | 60.34% |
| Never |
|
5 | 8.62% |
| Commenting? |
|
1 | 1.72% |
| Voters: 58. You may not vote on this poll | |||
![]() |
|
|
Thread Tools | Display Modes |
|
|
#21 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
When I code I write a classes header file first, then comment the class, its member functions and variables in doxygen style. Then I actually write the class. This is followed by a unit test suite that tests to make sure every method of the class does what the documentation says it does. This is all quite helpful in forcing you to design your classes well. This all goes along with proper variable and function naming.
I would like to say the people who claim there code is "self-documenting" have not come back to code they wrote a long time ago. Self-documenting is true for body of simple functions, but you can't expect a function name to convey as much information as this. Ogre is quite a good project to see how a pretty well written, documented and layed out project should look like. |
|
|
|
|
|
#22 |
|
Programmer
Join Date: May 2006
Posts: 85
Rep Power: 3
![]() |
New guy sounds smart.... Welcome to the PFO forums...
__________________
Code Forums |
|
|
|
|
|
#23 | |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
Quote:
. That said it really does take quite some time to do the whole the Document-Code-Test cycle, but at least it gives you a safety net. Most of the stuff I code has to be used by other people, so the more copious my documentation and testing the more effective it will be. |
|
|
|
|
|
|
#24 |
|
Programmer
Join Date: May 2006
Posts: 85
Rep Power: 3
![]() |
I agree. The apps I work with/on are used by other people and if they need to look at the source and its not commented they have no idea what I am talking about.
__________________
Code Forums |
|
|
|
|
|
#25 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 214
Rep Power: 0
![]() |
I comment everything!!!! line by line, even if it's wrong to do so.
This is mainly due to the fact that I have a horrible memory and so the comments help me remember what I'm doing.
__________________
Death smiles at us all. All a man can do is smile back. |
|
|
|
|
|
#26 |
|
Programmer
Join Date: May 2006
Posts: 85
Rep Power: 3
![]() |
Good practice I guess...
__________________
Code Forums |
|
|
|
|
|
#27 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 763
Rep Power: 3
![]() |
I'd say overcommenting is actually not good. While you can definitely see what your code does later, well, if you need the comments on every line later, you might not want to be programming much. But even when you're first writing the code, if you comment each line, you're spending a rough estimate of 30-50% of your coding time writing comments. Not particularly efficient. That's not to say that spending a certain amount of time on commenting is bad, but there's such a thing as too much.
|
|
|
|
|
|
#28 |
|
Programmer
Join Date: May 2006
Posts: 85
Rep Power: 3
![]() |
True I see your point.
__________________
Code Forums |
|
|
|
|
|
#29 | |
|
Hobbyist Programmer
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3
![]() |
Quote:
|
|
|
|
|
|
|
#30 | |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 214
Rep Power: 0
![]() |
Quote:
__________________
Death smiles at us all. All a man can do is smile back. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|