Practical, Pragmatic, C++
RSS icon Email icon Home icon
  • Header Files

    Posted on March 21st, 2009 wozname 1 comment

    The physical design of a project is a vast topic, I think it will be useful to suggest some simple practices that will help point you in the right direction when you are just starting a project. They can also be applied to a large project but more care is needed.

    The first things you can do:

    1. Make all headers standalone
    2. Keep your classes in seperateĀ .hpp and .cpp pairs, aim for one class per file.
    3. Use precompiled headers as an optimisation technique and nothing more.
    4. Don’tĀ put using namespace in any of your header files, you’ll pollute the namespace.
    5. Be careful of templates and where they are defined.

    Read the rest of this entry »

  • Physical Design

    Posted on March 18th, 2009 wozname No comments

    One of the most important but underrated aspects of a large C++ project is its physical design. The logical design could be the most beautiful thing in the world, yet the physical design can still slow your builds down and generate confusion in a project. You could for instance “modularise” a project by separating it into several DLL’s but still have it heavily coupled due to poorly defined and implemented interfaces.

    More often a poor physical design reflects a poor logical design.

    What is the physical design?

    The physical design consists of all the physical aspects of the project

    • The physical files and directories of the project.
    • How they are divided into modules or libraries.
    • The dependencies between the files and modules.

    Read the rest of this entry »

  • First Post

    Posted on March 17th, 2009 wozname No comments

    This is the first post!

    I have a filing cabinet full of goodness that I can’t wait to share with you.

    More to come…