+<H1>General design priciples</H1>
+ <P>
+ Here's a few pragmatic programmer guidelines to follow (<A HREF="http://www.codinghorror.com/blog/files/Pragmatic%20Quick%20Reference.htm">Web version</A>)
+ <H3>Details <input type="button" value="Hide" onclick="toggleVisibility( this, 'general_details' );"/></H3>
+ <ARTICLE class="detail" id="general_details">
+ <UL>
+ <LI><B>Care About the Software, Care about your API users and end users</B><BR>
+ Why spend your life developing software unless you care about doing it well?
+ Turn off the autopilot and take control. Constantly critique and appraise your work.
+ <LI><B>Don't Live with Broken Windows</B><BR>
+ Fix bad designs, wrong decisions, and poor code when you see them.
+ You can't force change on people. Instead, show them how the future might be and help them participate in creating it.
+ <LI><B>Remember the Big Picture</B><BR>
+ Don't get so engrossed in the details that you forget to check what's happening around you.
+ <LI><B>DRY - Don't Repeat Yourself</B><BR>
+ Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
+ <LI><B>Eliminate Effects Between Unrelated Things</B><BR>
+ Design components that are self-contained. independent, and have a single, well-defined purpose.
+ <LI><B>There Are No Final Decisions</B><BR>
+ No decision is cast in stone. Instead, consider each as being written in the sand at the beach, and plan for change.
+ <LI><B>Fix the Problem, Not the Blame</B><BR>
+ It doesn't really matter whether the bug is your fault or someone else's—it is still your problem, and it still needs to be fixed.
+ <LI><B>You Can't Write Perfect Software</B><BR>
+ Software can't be perfect. Protect your code and users from the inevitable errors.
+ <LI><B>Design with Contracts</B><BR>
+ Use contracts to document and verify that code does no more and no less than it claims to do.
+ <LI><B>Crash Early</B><BR>
+ A dead program normally does a lot less damage than a crippled one.
+ <LI><B>Use Assertions to Prevent the Impossible</B><BR>
+ Assertions validate your assumptions. Use them to protect your code from an uncertain world.
+ <LI><B>Use Exceptions for Exceptional Problems</B><BR>
+ Exceptions can suffer from all the readability and maintainability problems of classic spaghetti code. Reserve exceptions for exceptional things.
+ <LI><B>Minimize Coupling Between Modules</B><BR>
+ Avoid coupling by writing "shy" code and applying the Law of Demeter.
+ <LI><B>Put Abstractions in Code, Details in Metadata</B><BR>
+ Program for the general case, and put the specifics outside the compiled code base.
+ <LI><B>Always Design for Concurrency</B><BR>
+ Allow for concurrency, and you'll design cleaner interfaces with fewer assumptions.
+ <LI><B>Don't Program by Coincidence</B><BR>
+ Rely only on reliable things. Beware of accidental complexity, and don't confuse a happy coincidence with a purposeful plan.
+ <LI><B>Test Your Estimates</B><BR>
+ Mathematical analysis of algorithms doesn't tell you everything. Try timing your code in its target environment.
+ <LI><B>Refactor Early, Refactor Often</B><BR>
+ Just as you might weed and rearrange a garden, rewrite, rework, and re-architect code when it needs it. Fix the root of the problem.
+ <LI><B>Design to Test</B><BR>
+ Start thinking about testing before you write a line of code.
+ <LI><B>Abstractions Live Longer than Details</B><BR>
+ Invest in the abstraction, not the implementation. Abstractions can survive the barrage of changes from different implementations and new technologies.
+ <LI><B>Coding Ain't Done 'Til All the Tests Run</B><BR>
+ 'Nuff said.
+ <LI><B>Use Saboteurs to Test Your Testing</B><BR>
+ Introduce bugs on purpose in a separate copy of the source to verify that testing will catch them.
+ <LI><B>Find Bugs Once</B><BR>
+ Once a human tester finds a bug, it should be the last time a human tester finds that bug. Automatic tests should check for it from then on.
+ <LI><B>Sign Your Work</B><BR>
+ Craftsmen of an earlier age were proud to sign their work. You should be, too.
+ </UL>
+ </ARTICLE>
+ </P>
+
+ <H2>Avoid Tight Coupling</H2>
+ <P>
+ Always choose the loosest possible coupling between entities. In C++ the tightest coupling is Friend, second is Inheritance,
+ then Containment and last is Usage through reference, pointer or handle.
+ <H3>Details <input type="button" value="Hide" onclick="toggleVisibility( this, 'coupling_details' );"/></H3>
+ <ARTICLE class="detail" id="coupling_details">
+ <UL>
+ <LI>Friend defines a "must-know" about details of implementation, don't use it unless your happy stating that Xxx really <B>must</B> know about Yyy implementation. and Yyy can never change without informing Xxx.
+ <LI>Inheritance defines a "is-a" relationship, don't use it unless you really can naturally say Xxx is-a Yyy. Most of the cases containment through interface is what you
+ <LI>Containment defines a "owns-a" relationship, use it when you have a natural Xxx owns-a Yyy relationship.
+ </UL>
+ Most of the time containment through interface and normal usage is what you should go for.
+ Strong ownership always beats sharing through reference counting. Reference counting means "part owns".
+ You would not want to part own anything in real life, so why do that in software? sooner or later it will leak,
+ </ARTICLE>
+ </P>
+
+ Two key principles to follow:
+ <H2>Open Closed Principle</H2>
+ <P>
+ Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.
+ That is, such an entity can allow its behaviour to be modified without altering its source code. Techniqu
+ </P>
+
+ <H2>Dependency Inversion Principle</H2>
+ <P>
+ High-level modules should not depend on low-level modules. Both should depend on abstractions.
+ Abstractions should not depend upon details. Details should depend upon abstractions.
+ </P>
+