 |
Who's Online |
 |
|
There are currently, 2 guest(s) and 0 member(s) that are online.
You are Anonymous user. You can register for free by clicking here
|
|
|
 |
| |
Volunteer: Help us document C++ headers!
Posted by HopeSeekr on Tuesday, June 22 @ 22:53:13 CDT
Contributed by HopeSeekr
One of the main necessities in order to have a maintainable application the size of xMule is minimal module interdependency. And xMule (like its parent, eMule, and child, aMule) is *severely* coupled. Help solve this problem in a critical way by helping us document header inclusions....
The Process has already begun...
The only way we can even begin tackling the monster called Decoupling, we *must* figure out at a minimum why each header is needed wherever it is included in the application.
Thus we turn relatively unfriendly header statements like
#include "xmule.h"
into the much more hospitable form of
#include "xmule.h" // Needed for theApp
This needs to be done for *every* #included file *every*where*. Fortunately it is easy and fun to do :-) Here is a real-world example using AddFileThread.cpp from CVS.
Step 1: Comment out a #include statement.
//#include "xmule.h"
Step 2: Compile xMule.
xmule/] $ make
Step 3: Find out why the header is needed, if it is.
Compiling AddFileThread.cpp...
AddFileThread.cpp: In member function `virtual void* CAddFileThread::Entry()':
AddFileThread.cpp:93: error: `theApp' undeclared (first use this function)
Step 4: Log the first dependency.
#include "xmule.h" // Needed for theApp
Step 5: Make a patch and send to Ted.
xmule/] $ cvs diff -u > AddFileThread.patch
There only a few coding guidelines for this task:
Use // not /* */ for commenting headers.
Use *spaces* NOT tabs
Start the // at column 41, as this allows us to see the comment on a screen with resolution 1024 or better, and we can align the header comments.
A really nice editor, and one that all the developers of xMule use, is Vim and its GUI front-end GVim. If you choose to use this wonderful editor, my personal .vimrc is all you will need to be sure that you use spaces instead of tabs, and that vim behaves 'properly'. Simply put the vimrc as ~/.vimrc. Finally, look here to Learn vim in 15 minutes, a wonderful Quick Start Vim guide.
As usual, I am available for your support in these and other endeavors either via IRC at #xmule on Undernet or via email at hopeseekr at xmule dot ws.
Cheers,
- hope
Note: This task was completed by HopeSeekr
|
|
| |
 |
Login |
 |
|
|
Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.
|
|
|
 |
 |
Article Rating |
 |
|
Average Score: 1 Votes: 1

|
|
|
 |
|
Associated Topics
 |
|
|
No Comments Allowed for Anonymous, please register |
|
|