The Importance of Commenting Code

Standard

Dungeon University¬†is the work of a tiny handful of people. I do the basics myself, calling in others when my own skill doesn’t seem to be enough. When I first got to work on it, I assumed that the people I started with would stay with it–after all, it’s not a huge project, right?

Well, a lot of time has passed. I’m faced with issues like trying to get a newer character artist to mimic the previous one, waiting what seems like forever for music, and, finally, learning to program for myself.

It’s not that the original programmer has left or anything. Actually, we’re good friends and I talk to him a lot. But this isn’t his labor of love like it is mine, and he just can’t put in the hours every week like I do. So I’m trying to write code based on a framework that I don’t fully understand or even know about. I tried using my basic knowledge to get going, but that resulted in a lot of errors that I couldn’t seem to trace effectively.

How much better would it be if I just knew what was going on? In order to help solve this, I decided to right a wrong in the previous programming–almost none of it was documented. So, I went into every class, variable and function and gave almost all of them the C# summary tags. Often, the names of these things made them super obvious, but I documented them in detail anyway.

The documentation is now there for future reference. More importantly, in doing this I had to go into every script and examine its parts carefully. Some of the explanations took a few extra steps to come up with, but now that I’ve seen it, I get it.

If you’re working on a programming project now or in the future, I recommend documenting it thoroughly. Even if it seems silly, it’s not a waste of time. Who knows when you’ll come back to it again?

Advertisements

Please leave a comment!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s