Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

// This is a thread about comments in C code

Name: Anonymous 2013-07-21 0:02

So, I've always been pretty bad at properly commenting my code. It has mostly been an utter mess without any structure or distinguishable style whatsoever.
Then a few weeks ago a project of mine was starting to get pretty big, and I started to notice that there was no way I was going to be able to maintain or edit the code unless I started structuring it better.
And so I started commenting. At first it was great. My code was readable and very easy to recognize and edit as needed. I was loving it, and looking back at my old code, I couldn't believe how I could have lived without such structure and readability.
But as the code grew, so did my desire to comment. Soon commenting once every 5-10 lines didn't do it for me anymore. I needed more, and so the comments grew longer and more frequent. Before I realized it my code had become nothing but a big grey text document with an occasional C stament thrown in here and there.
It wasn't until I looked back and saw the following line that I realized I needed help;
    // Take a number which is five and then add it to another number which is also five and then assign it to the variable that is named FiveAndFiveTogetherEqualsTheValueOfThisVariableWhichIsOfTypeInt which is of type int.
FiveAndFiveTogetherEqualsTheValueOfThisVariableWhichIsOfTypeInt = 5 + 5;
The code is slightly dramatized.
There are overly verbose (compare http://www.youtube.com/watch?v=wz_K1Gjrx8c) comments at least once every other line, sometimes spanning multiple lines, which are now having the opposite of intended effect on the readability of the code, and slowing me down quite heavily.
I've tried to restrain myself, but I just don't have the mental force or self-control to do it. I think I will have to refrain from coding at all for a while.
Does anyone have any similar experiences, or advice? Any help would be greatly appreciated.

Name: Anonymous 2013-07-21 2:02

Restrict your variable names to six (or something similar) characters.
No.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List