Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #20

Merged
merged 6 commits into from Aug 7, 2014
Merged

Documentation #20

merged 6 commits into from Aug 7, 2014

Conversation

Copy link

@KatrinaHoffert KatrinaHoffert commented Jul 20, 2014

Start of introducing serious documentation into MegaGlest.

Doxygen is used for creating HTML files from the sources. Right now, those HTML files are of limited use because most of the code has no useable documentation. But eventually, I hope that a useful portion of the code will have this documentation, in which case Doxygen provides an easy means of structuring the docs.

As well, the use of Doxygen forces some conventions on our documentation. I'm currently using Javadoc style documentation. It's what I'm most familiar with and it is, in my opinion, more readable than the Qt style (the first sentence becomes the brief in JD style, while Qt style has to use a tag for that).

Anyway, at the time of writing this pull request, I've documented most of the upgrade_type.h file. This pull request may have further documentation added to it before it's pulled.

There shouldn't be any major issues with merging the documentation. Even if conflicts happen, they should be easy to resolve, as there's absolutely no real changes in this branch.

I also use the following, additional conventions when documenting code:

  1. Simple getters and setters don't get documented (but more complicated ones may need docs)
  2. Same with simple fields.
  3. I don't document obvious return values. Particularly if the description of the method pretty much says what is being returned.
  4. The method description is the most important part. Everything else is optional (although I try and get most parameters).
  5. With delegate methods, I simply say that they're a delegate and link to the real method (as an aside, the Doxygen visibility likely needs to be set to document private members, otherwise some links won't work).
  6. Readable source code is priority over Doxygen's generated output.
  7. Focus is on making members and fields documented (as opposed to documenting on a line-by-line basis). This means that most documentation should be in header files. I consider this documentation the most important because it is better suited to explain why things are done in a certain way and what the high level goal is. After all, the code itself says what the line-by-line is doing.

Mike Hoffert added 6 commits Jul 20, 2014
Output folder is ignored by Git
Namespaces Glest and Game are now commented. To avoid unnecessary
duplication, they're only commented in one place (main.cpp).
titiger added a commit that referenced this issue Aug 7, 2014
Documentation is always a good thing
@titiger titiger merged commit ad5e978 into MegaGlest:develop Aug 7, 2014
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants