Should the FZ3-Sourcecode be commented or not?
Moderator: Project members
Should the FZ3-Sourcecode be commented or not?
To all the programmers out there:
Do you think code must be commented?
Why?
Why not?
Do you think code must be commented?
Why?
Why not?
-
- 500 Syntax error
- Posts: 13
- Joined: 2004-06-14 05:59
- Location: Netanya, Israel
Commenting is not talking to yourself.
If you don't hack on FZ for some years, your own commentts might get you started again quickly.
Now think about noobs. Commented code is really good idea to get noobs started quickly.
Now, I agree, that switching from coding to commenting take time and more importantly deconcentrates you, but are you always concentrated?
I'm sure, not. A human being can NOT be always concentrated, we aren't a robots. So, I was commenting my project, when I wasn't hacking on it.
Also, in this case of FZ, the one that programs, don't have to comment,
it can be done by another volunteer.
Sorry, didn't wanted to interfere your work.
-Fenix*NBK*
If you don't hack on FZ for some years, your own commentts might get you started again quickly.
Now think about noobs. Commented code is really good idea to get noobs started quickly.
Now, I agree, that switching from coding to commenting take time and more importantly deconcentrates you, but are you always concentrated?
I'm sure, not. A human being can NOT be always concentrated, we aren't a robots. So, I was commenting my project, when I wasn't hacking on it.
Also, in this case of FZ, the one that programs, don't have to comment,
it can be done by another volunteer.
Sorry, didn't wanted to interfere your work.
-Fenix*NBK*
-
- 450 Internal Error
- Posts: 39
- Joined: 2004-08-18 15:53
If a project is really open-source it should always be commented. Otherwise it's not really "open-source" in my book, it's simply code made available for others to examine.
For those that don't believe in commenting I feel sorry for the developer that ever has to work with your code, or even yourself a year after you last touched it. As a senior software developer at a company I constantly have to school new junior code monkeys on commenting. Like someone else mentioned code should be for the most part self-commenting but any project of any complexity has tricky sections. Any hacks for various OS's, reasons why you are creating an object in one location vs another so you don't forget and try to over-optimize, etc.
Funny thing is they always think they know better (hell, even I did when I was first cutting my teeth) so I always give them the task of fixing a few bugs and adding a few new features to a project another junior code monkey wrote, sans comments. Ahh, how I love hearing them complain, or better yet completely screw things up because they didn't understand the system fully.
Oh, and there is nothing wrong with talking to yourself, several studies have even suggested that people falling into the "creative genius" category routinely talk to themselves *grin*.
For those that don't believe in commenting I feel sorry for the developer that ever has to work with your code, or even yourself a year after you last touched it. As a senior software developer at a company I constantly have to school new junior code monkeys on commenting. Like someone else mentioned code should be for the most part self-commenting but any project of any complexity has tricky sections. Any hacks for various OS's, reasons why you are creating an object in one location vs another so you don't forget and try to over-optimize, etc.
Funny thing is they always think they know better (hell, even I did when I was first cutting my teeth) so I always give them the task of fixing a few bugs and adding a few new features to a project another junior code monkey wrote, sans comments. Ahh, how I love hearing them complain, or better yet completely screw things up because they didn't understand the system fully.
Oh, and there is nothing wrong with talking to yourself, several studies have even suggested that people falling into the "creative genius" category routinely talk to themselves *grin*.
I believe that documentation is a must. However I also agree that it disrupts my work flow. This is why I generally write a load of code, and then spend an hour the next morning, or the same evening documenting what has been written..
This provides me, and my colleagues with the bonuses of:
A) I can understand the method behind my own madness.
B) It can present fundamental flaws i nmy approach to something
C) It gives others, especially with a skillset difference, a chance to understand the concepts and methedologies behind what I am accomplishing. However, that is not to say that my programming is unclean. It turns out to be very handy for "junior" programmers who are trying to grasp the concepts of something to read the documentation rather than taking up my time with the question (of which I have no problems in answering, but it saves me hassle at the end of the day)
I am by no means at the top of the game, christ, I dont write c++.
This provides me, and my colleagues with the bonuses of:
A) I can understand the method behind my own madness.
B) It can present fundamental flaws i nmy approach to something
C) It gives others, especially with a skillset difference, a chance to understand the concepts and methedologies behind what I am accomplishing. However, that is not to say that my programming is unclean. It turns out to be very handy for "junior" programmers who are trying to grasp the concepts of something to read the documentation rather than taking up my time with the question (of which I have no problems in answering, but it saves me hassle at the end of the day)
I am by no means at the top of the game, christ, I dont write c++.
-
- 500 Command not understood
- Posts: 1
- Joined: 2004-11-30 23:36
- Location: Canada
i vote for comments because i have many times come back to some of my own work and said to myself "what the hell is that?!"
usually followed by "how the fuck did i manage to do that" or "i didnt know i knew how to do that!"
think of your comments as talking to a buddy, or an idiot (depending on your mood) not as talking to yourself
usually followed by "how the fuck did i manage to do that" or "i didnt know i knew how to do that!"
think of your comments as talking to a buddy, or an idiot (depending on your mood) not as talking to yourself
hi guys: nice discussion and an even nicer program: perfect!
I just registered here to give my 2 cents to it: I do not comment code that I write by the way. I just comment them if I expect other coders will read them. Since I am very active in codeguru some small explanations and comments in the code samples I provide are invalueable. . And sometimes I write comments just to amuse myself If I read them again, and even sometimes a piece of code becomes something like a diary. As has been said above: Commenting interrupts the workflow. Thats absolutly correct. So I write a peace of code, and then comment it. I do not comment each silly line and I do not comment through complex algorithms but I give a small explanation for what I am doing here, even If I have no clue what I am doing here. Do not take it to serious comment can be funny . Some extractions:
So do not take it so serious ...
I just registered here to give my 2 cents to it: I do not comment code that I write by the way. I just comment them if I expect other coders will read them. Since I am very active in codeguru some small explanations and comments in the code samples I provide are invalueable. . And sometimes I write comments just to amuse myself If I read them again, and even sometimes a piece of code becomes something like a diary. As has been said above: Commenting interrupts the workflow. Thats absolutly correct. So I write a peace of code, and then comment it. I do not comment each silly line and I do not comment through complex algorithms but I give a small explanation for what I am doing here, even If I have no clue what I am doing here. Do not take it to serious comment can be funny . Some extractions:
Code: Select all
TreeItem * TreeItem::GetFirstSon ( )
{
// some code
// *darthvader-voice* I am your father m_Son[0]
return m_Son[0];
}
Code: Select all
// FIXXME: Complete this function ... I NEED TO PLAY QUAKE3! NOW!
void CMainDialog::OnServerRestart ( void )
{
}
// END FIXXMEE