Author Topic: Suggested Code::Blocks rules on using Headers.  (Read 3230 times)

Online stahta01

  • Lives here!
  • ****
  • Posts: 7594
    • My Best Post
Suggested Code::Blocks rules on using Headers.
« on: October 10, 2007, 08:38:12 am »
FYI:

I have been thinking that it would be a good idea to have a list of rules on using headers in Code::Blocks.
I have figured out some possible rules from killerbot and thinking about it myself.

Please comment about these rules and suggest others.

Tim S

killerbot inspired ones.
1. If possible, headers should use forward declarations instead of includes.

2. Headers should never include pre-compiled headers like [sdk.h] or [wxprec.h].
    Do not include sdk.h in headers
    Do not include wxprec.h in headers
    Do not use WX_PRECOMP in headers
    Do not use CB_PRECOMP in headers

Ones I decided on by myself.
3. Used system includes in plugins for C::B SDK and wxWidgets includes.
   In plugins, use [#include <sdk.h>] instead of [#include "sdk.h"]

4. Do not use [#include <wx/wx.h>] in either production headers or source code.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org